Bulk operation status endpoints
Magento generates a bulk_uuid
each time it executes an asynchronous API request. You can track the status of an asynchronous operation with the following endpoints:
GET /V1/bulk/:bulkUuid/status
GET /V1/bulk/:bulkUuid/operation-status/:status
GET /V1/bulk/:bulkUuid/detailed-status
Get the status summary
The GET <host>/rest/<store_code>/V1/bulk/:bulkUuid/status
endpoint returns the abbreviated status of the specified operation:
Field name | Data type | Description |
---|---|---|
operations_list |
Object | An array containing information about each operation in a bulk or asynchronous request. |
id |
Integer | Identifies the bulk or asynchronous request. |
status |
Integer | The operation status * 1 = Complete * 2 = The operation failed, but you can try to perform it again* 3 = The operation failed. You must change something to retry it.* 4 = Open* 5 = Rejected |
result_message |
String | Describes the result of the operation. If successful, the value contains the string Service execution success as well as the method that executed the operation. |
error_code |
Integer | If applicable, an error code associated with the operation. |
user_type |
Integer | Type of user who made this request. Possible values are: * 1 = Integration * 2 = Administrator * 3 = Customer * 4 = Guest User |
bulk_id |
String | UUID generated by an asynchronous API request or Bulk API request. |
description |
String | Contains the message queue topic. |
start_time |
String | The time that a bulk or asynchronous operation started. |
user_id |
Integer | The user ID that executed the request. |
operation_count |
Integer | The number of operations processed in the request. |
Response:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"operations_list": [
{
"id": 12,
"status": 1,
"result_message": "Service execution success Magento\\Catalog\\Model\\ProductRepository\\Interceptor::save",
"error_code": null
}
],
"user_type": 2,
"bulk_id": "fbfca270-7a90-4c4e-9f32-d6cf3728cdc7",
"description": "Topic async.magento.catalog.api.productrepositoryinterface.save.put",
"start_time": "2018-07-12 16:07:53",
"user_id": 1,
"operation_count": 1
}
Get operations count by bulk uuid and status
The GET <host>/rest/<store_code>/V1/bulk/:bulkUuid/operation-status/:status
endpoint returns the number of operations from the bulk batch that have the specified status.
Status | Description |
---|---|
1 |
Complete |
2 |
The operation failed, but you can try to perform it again. |
3 |
The operation failed. You must change something to retry it. |
4 |
Open |
5 |
Rejected |
Response:
1
0
Get the detailed status
The GET /V1/bulk/:bulkUuid/detailed-status
endpoint returns detailed information about status of a specified operation. It is similar to the GET /V1/bulk/:bulkUuid/status
endpoint, except that the operations_list
array also contains the message queue topic name and serialized data for each operation.
1
GET <host>/rest/<store_code>/V1/bulk/:bulkUuid/detailed-status
Field name | Data type | Description |
---|---|---|
operations_list |
Object | An array containing information about each operation in a bulk or asynchronous request. |
id |
Integer | Identifies the bulk or asynchronous request. |
bulk_uuid |
String | UUID generated by an asynchronous API request or Bulk API request. |
topic_name |
String | The name of the message queue topic, in the format async.<service.contract.path>.<method> . The service contract path is lowercase, and the method is either post , put , or delete . |
serialized_data |
String | An array of serialized input data. It contains serialized JSON with the following keys: entity_id - null , entity_link - an empty string, meta_info - the body of the API request that was executed. |
result_serialized_data |
String | Contains serialized output of the corresponding synchronous API call. For example, if you call POST /async/V1/products , this field contains serialized response from POST /V1/products . |
status |
Integer | The operation status * 1 = Complete * 2 = The operation failed, but you can try to perform it again* 3 = The operation failed. You must change something to retry it.* 4 = Open* 5 = Rejected |
result_message |
String | Describes the result of the operation. If successful, the value contains the string Service execution success as well as the method that executed the operation. |
error_code |
Integer | If applicable, an error code associated with the operation. |
user_type |
Integer | Type of user who made this request. Possible values are: * 1 = Integration * 2 = Administrator * 3 = Customer * 4 = Guest User |
bulk_id |
String | UUID generated by an asynchronous API request or Bulk API request. |
description |
String | Contains the message queue topic name. |
start_time |
String | The time that a bulk or asynchronous operation started. |
user_id |
Integer | The user ID that executed the request. |
operation_count |
Integer | The number of operations processed in the request. |
Response:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
"operations_list": [
{
"id": 4,
"bulk_uuid": "c43ed402-3dd3-4100-92e2-dc5852d3009b",
"topic_name": "async.magento.customer.api.accountmanagementinterface.createaccount.post",
"serialized_data": "{\"entity_id\":null,\"entity_link\":\"\",\"meta_information\":\"{\\\"customer\\\":{\\\"email\\\":\\\"mshaw@example.com\\\",\\\"firstname\\\":\\\"Melanie Shaw\\\",\\\"lastname\\\":\\\"Doe\\\"},\\\"password\\\":\\\"Password1\\\",\\\"redirectUrl\\\":\\\"\\\"}\"}",
"result_serialized_data": null,
"status": 3,
"result_message": "A customer with the same email address already exists in an associated website.",
"error_code": 0
},
{
"id": 5,
"bulk_uuid": "c43ed402-3dd3-4100-92e2-dc5852d3009b",
"topic_name": "async.magento.customer.api.accountmanagementinterface.createaccount.post",
"serialized_data": "{\"entity_id\":null,\"entity_link\":\"\",\"meta_information\":\"{\\\"customer\\\":{\\\"email\\\":\\\"bmartin@example.com\\\",\\\"firstname\\\":\\\"Bryce\\\",\\\"lastname\\\":\\\"Martin\\\"},\\\"password\\\":\\\"Password1\\\",\\\"redirectUrl\\\":\\\"\\\"}\"}",
"result_serialized_data": null,
"status": 3,
"result_message": "A customer with the same email address already exists in an associated website.",
"error_code": 0
},
{
"id": 6,
"bulk_uuid": "c43ed402-3dd3-4100-92e2-dc5852d3009b",
"topic_name": "async.magento.customer.api.accountmanagementinterface.createaccount.post",
"serialized_data": "{\"entity_id\":null,\"entity_link\":\"\",\"meta_information\":\"{\\\"customer\\\":{\\\"email\\\":\\\"bmartin@example.com\\\",\\\"firstname\\\":\\\"Bryce\\\",\\\"lastname\\\":\\\"Martin\\\"},\\\"password\\\":\\\"Password1\\\",\\\"redirectUrl\\\":\\\"\\\"}\"}",
"result_serialized_data": null,
"status": 3,
"result_message": "A customer with the same email address already exists in an associated website.",
"error_code": 0
},
{
"id": 7,
"bulk_uuid": "c43ed402-3dd3-4100-92e2-dc5852d3009b",
"topic_name": "async.magento.customer.api.accountmanagementinterface.createaccount.post",
"serialized_data": "{\"entity_id\":null,\"entity_link\":\"\",\"meta_information\":\"{\\\"customer\\\":{\\\"email\\\":\\\"tgomez@example.com\\\",\\\"firstname\\\":\\\"Teresa\\\",\\\"lastname\\\":\\\"Gomez\\\"},\\\"password\\\":\\\"Password1\\\",\\\"redirectUrl\\\":\\\"\\\"}\"}",
"result_serialized_data": null,
"status": 3,
"result_message": "A customer with the same email address already exists in an associated website.",
"error_code": 0
}
],
"user_type": 2,
"bulk_id": "c43ed402-3dd3-4100-92e2-dc5852d3009b",
"description": "Topic async.magento.customer.api.accountmanagementinterface.createaccount.post",
"start_time": "2018-07-11 20:07:14",
"user_id": null,
"operation_count": 4
}