Retry Async Task
1 min
POST
https://api.b.preview.loyaltyservices.io/api/v3/async-tasks/{asyncTaskId}/retry
Path Parameters
- asyncTaskIdinteger<int64>requiredDescriptionFormatint64
Responses
202
- AsyncTask
- asyncTaskIdinteger<int64>Formatint64
- taskTypeCodestringExampleDescription
- taskCodestringExampleDescription
- requestDatestring<date-time>DescriptionFormatdate-time
- requestDataobjectDescription
- statusCodestringDescription
- responseDatestring<date-time>DescriptionFormatdate-time
- responseDataobjectDescription
- fileNamestringDescription
- lineNumberintegerDescription
- fileDatastringDescription
400
- ErrorResponse
- errorsValidationError[]Description
- codestringDescription
- fieldNamestringDescription
- messagestringDescription
- messageParametersobject[]Description
401
403
404
- ErrorResponse
- errorsValidationError[]Description
- codestringDescription
- fieldNamestringDescription
- messagestringDescription
- messageParametersobject[]Description
500
curl
curl --request POST \
--url https://api.b.preview.loyaltyservices.io/api/v3/async-tasks/{asyncTaskId}/retry \
--header 'accept: application/json'ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.b.preview.loyaltyservices.io/api/v3/async-tasks/{asyncTaskId}/retry")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.b.preview.loyaltyservices.io/api/v3/async-tasks/{asyncTaskId}/retry"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.b.preview.loyaltyservices.io/api/v3/async-tasks/{asyncTaskId}/retry")
.method("POST", body)
.addHeader("accept", "application/json")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();202
// Accepted - New async task created and queued for processing
{
"asyncTaskId": "",
"taskTypeCode": "PlatformAPI",
"taskCode": "enrollMember",
"requestDate": "",
"requestData": {},
"statusCode": "",
"responseDate": "",
"responseData": {},
"fileName": "",
"lineNumber": 0,
"fileData": ""
}400
// Bad request - Task has invalid status (must be ERROR or QUEUED)
{
"errors": [
{
"code": "",
"fieldName": "",
"message": "",
"messageParameters": [
{}
]
}
]
}401
// Unauthorized
403
// Forbidden - Missing api:async-task scope
404
// Task not found
{
"errors": [
{
"code": "",
"fieldName": "",
"message": "",
"messageParameters": [
{}
]
}
]
}500
// Internal error