| 
1 | 1 | ---  | 
2 | 2 | group: rest  | 
3 |  | -title: Status endpoints  | 
 | 3 | +title: Bulk operation status endpoints  | 
4 | 4 | version: 2.3  | 
5 |  | -contributor_name: Oleksandr Lykun  | 
6 |  | -contributor_link:  | 
 | 5 | +contributor_name: comwrap GmbH  | 
 | 6 | +contributor_link: https://www.comwrap.com/  | 
7 | 7 | functional_areas:  | 
8 | 8 |   - Integration  | 
9 | 9 | ---  | 
 | 10 | + | 
 | 11 | +Magento generates a `bulk_uuid` each time it executes an [asynchronous API request]({{ page.baseurl }}/rest/asynchronous-web-endpoints.html). You can track the status of an asynchronous operation with the following endpoints:  | 
 | 12 | + | 
 | 13 | +* `GET /V1/bulk/:bulkUuid/status`  | 
 | 14 | +* `GET /V1/bulk/:bulkUuid/detailed-status`   | 
 | 15 | + | 
 | 16 | + | 
 | 17 | +## Get the status summary  | 
 | 18 | + | 
 | 19 | +The `GET /V1/bulk/:bulkUuid/status` endpoint returns the abbreviated status of the specified operation:  | 
 | 20 | + | 
 | 21 | +Field name | Data type | Description  | 
 | 22 | +--- | --- | ---  | 
 | 23 | +`operations_list` | Object | An array containing information about each operation in a bulk or asynchronous request.  | 
 | 24 | +`id` | Integer | Identifies the bulk or asynchronous request.  | 
 | 25 | +`status` | Integer | The operation status <br/>* `1` = Complete <br/>* `2` = The operation failed, but you can try to perform it again<br/>* `3` = The operation failed. You must change something to retry it.<br/>* `4` = Open<br/>* `5` = Rejected  | 
 | 26 | +`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.  | 
 | 27 | +`error_code` | Integer | If applicable, an error code associated with the operation.  | 
 | 28 | +`extension_attributes` | Object | Lists extension attributes.  | 
 | 29 | +`bulk_id` " String | UUID generated by an [asynchronous API request]({{ page.baseurl }}/rest/asynchronous-web-endpoints.html) or [Bulk API request]({{ page.baseurl }}/rest/bulk-endpoints.md).  | 
 | 30 | +`description` | String | Contains the message queue topic.  | 
 | 31 | +`start_time` | String | The time that a bulk or asynchronous operation started.  | 
 | 32 | +`user_id` | Integer | The user ID that executed the request.  | 
 | 33 | +`operation_count` | Integer | The number of operations processed in the request.  | 
 | 34 | + | 
 | 35 | +**Response**  | 
 | 36 | + | 
 | 37 | +```json  | 
 | 38 | +{  | 
 | 39 | +  "operations_list": [  | 
 | 40 | +    {  | 
 | 41 | +      "id": 12,  | 
 | 42 | +      "status": 1,  | 
 | 43 | +      "result_message": "Service execution success Magento\\Catalog\\Model\\ProductRepository\\Interceptor::save",  | 
 | 44 | +      "error_code": null  | 
 | 45 | +    }  | 
 | 46 | +  ],  | 
 | 47 | +  "bulk_id": "fbfca270-7a90-4c4e-9f32-d6cf3728cdc7",  | 
 | 48 | +  "description": "Topic async.V1.products.sku.PUT",  | 
 | 49 | +  "start_time": "2018-07-12 16:07:53",  | 
 | 50 | +  "user_id": null,  | 
 | 51 | +  "operation_count": 1  | 
 | 52 | +}  | 
 | 53 | +```  | 
 | 54 | + | 
 | 55 | +## Get the detailed status  | 
 | 56 | + | 
 | 57 | +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.  | 
 | 58 | +   | 
 | 59 | +```  | 
 | 60 | +GET /V1/bulk/:bulkUuid/detailed-status  | 
 | 61 | +```  | 
 | 62 | + | 
 | 63 | +Field name | Data type | Description  | 
 | 64 | +--- | --- | ---  | 
 | 65 | +`operations_list` | Object | An array containing information about each operation in a bulk or asynchronous request.  | 
 | 66 | +`id` | Integer | Identifies the bulk or asynchronous request.  | 
 | 67 | +`bulk_uuid` | String |  UUID generated by an [asynchronous API request]({{ page.baseurl }}/rest/asynchronous-web-endpoints.html) or [Bulk API request]({{ page.baseurl }}/rest/bulk-endpoints.md).  | 
 | 68 | +`topic_name` | String | The message queue topic.  | 
 | 69 | +`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.  | 
 | 70 | +`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`.  | 
 | 71 | +`status` | Integer | The operation status <br/>* `1` = Complete <br/>* `2` = The operation failed, but you can try to perform it again<br/>* `3` = The operation failed. You must change something to retry it.<br/>* `4` = Open<br/>* `5` = Rejected  | 
 | 72 | +`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.  | 
 | 73 | +`error_code` | Integer | If applicable, an error code associated with the operation.  | 
 | 74 | +`extension_attributes | Object | Lists extension attributes.  | 
 | 75 | +`bulk_id` " String | UUID generated by an [asynchronous API request]({{ page.baseurl }}/rest/asynchronous-web-endpoints.html) or [Bulk API request]({{ page.baseurl }}/rest/bulk-endpoints.md).  | 
 | 76 | +`description` | String | Contains the message queue topic.  | 
 | 77 | +`start_time` | String | The time that a bulk or asynchronous operation started.  | 
 | 78 | +`user_id` | Integer | The user ID that executed the request.  | 
 | 79 | +`operation_count` | Integer | The number of operations processed in the request.  | 
 | 80 | + | 
 | 81 | +**Response**  | 
 | 82 | + | 
 | 83 | +```json  | 
 | 84 | +{  | 
 | 85 | +  "operations_list": [  | 
 | 86 | +    {  | 
 | 87 | +      "id": 4,  | 
 | 88 | +      "bulk_uuid": "c43ed402-3dd3-4100-92e2-dc5852d3009b",  | 
 | 89 | +      "topic_name": "async.V1.customers.POST",  | 
 | 90 | +      "serialized_data":  "{\"entity_id\":null,\"entity_link\":\"\",\"meta_information\":\"{\\\"customer\\\":{\\\"email\\\":\\\"[email protected]\\\",\\\"firstname\\\":\\\"Melanie Shaw\\\",\\\"lastname\\\":\\\"Doe\\\"},\\\"password\\\":\\\"Password1\\\",\\\"redirectUrl\\\":\\\"\\\"}\"}",   | 
 | 91 | +      "result_serialized_data": null,  | 
 | 92 | +      "status": 3,  | 
 | 93 | +      "result_message": "A customer with the same email address already exists in an associated website.",  | 
 | 94 | +      "error_code": 0  | 
 | 95 | +    },  | 
 | 96 | +    {  | 
 | 97 | +      "id": 5,  | 
 | 98 | +      "bulk_uuid": "c43ed402-3dd3-4100-92e2-dc5852d3009b",  | 
 | 99 | +      "topic_name": "async.V1.customers.POST",  | 
 | 100 | +      "serialized_data":  "{\"entity_id\":null,\"entity_link\":\"\",\"meta_information\":\"{\\\"customer\\\":{\\\"email\\\":\\\"[email protected]\\\",\\\"firstname\\\":\\\"Bryce\\\",\\\"lastname\\\":\\\"Martin\\\"},\\\"password\\\":\\\"Password1\\\",\\\"redirectUrl\\\":\\\"\\\"}\"}",   | 
 | 101 | +      "result_serialized_data": null,  | 
 | 102 | +      "status": 3,  | 
 | 103 | +      "result_message": "A customer with the same email address already exists in an associated website.",  | 
 | 104 | +      "error_code": 0  | 
 | 105 | +    },  | 
 | 106 | +    {  | 
 | 107 | +      "id": 6,  | 
 | 108 | +      "bulk_uuid": "c43ed402-3dd3-4100-92e2-dc5852d3009b",  | 
 | 109 | +      "topic_name": "async.V1.customers.POST",  | 
 | 110 | +      "serialized_data":  "{\"entity_id\":null,\"entity_link\":\"\",\"meta_information\":\"{\\\"customer\\\":{\\\"email\\\":\\\"[email protected]\\\",\\\"firstname\\\":\\\"Bryce\\\",\\\"lastname\\\":\\\"Martin\\\"},\\\"password\\\":\\\"Password1\\\",\\\"redirectUrl\\\":\\\"\\\"}\"}",   | 
 | 111 | +      "result_serialized_data": null,  | 
 | 112 | +      "status": 3,  | 
 | 113 | +      "result_message": "A customer with the same email address already exists in an associated website.",  | 
 | 114 | +      "error_code": 0  | 
 | 115 | +    },  | 
 | 116 | +    {  | 
 | 117 | +      "id": 7,  | 
 | 118 | +      "bulk_uuid": "c43ed402-3dd3-4100-92e2-dc5852d3009b",  | 
 | 119 | +      "topic_name": "async.V1.customers.POST",  | 
 | 120 | +      "serialized_data":  "{\"entity_id\":null,\"entity_link\":\"\",\"meta_information\":\"{\\\"customer\\\":{\\\"email\\\":\\\"[email protected]\\\",\\\"firstname\\\":\\\"Teresa\\\",\\\"lastname\\\":\\\"Gomez\\\"},\\\"password\\\":\\\"Password1\\\",\\\"redirectUrl\\\":\\\"\\\"}\"}",   | 
 | 121 | +      "result_serialized_data": null,  | 
 | 122 | +      "status": 3,  | 
 | 123 | +      "result_message": "A customer with the same email address already exists in an associated website.",  | 
 | 124 | +      "error_code": 0  | 
 | 125 | +    }  | 
 | 126 | +  ],  | 
 | 127 | +  "bulk_id": "c43ed402-3dd3-4100-92e2-dc5852d3009b",  | 
 | 128 | +  "description": "Topic async.V1.customers.POST",  | 
 | 129 | +  "start_time": "2018-07-11 20:07:14",  | 
 | 130 | +  "user_id": null,  | 
 | 131 | +  "operation_count": 4  | 
 | 132 | +}  | 
 | 133 | +```  | 
0 commit comments