Bulk update (asynchronous)
Start a new asynchronous bulk update, or retrieve the status of the current or last asynchronous bulk update.
The expected POST data is the same as for the synchronous bulk update at /api/senders/bulk_update
The response is a status message about the bulk update. During the update, you can retrieve the status with a GET to /api/senders/bulk_update_async
When the update has finished, you can retrieve a full status report with a GET to to /api/senders/bulk_update_async_report
This report has the same format as the reponse to the synchronous bulk update at /api/senders/bulk_update.
Start the asynchronous bulk update
Method and endpoint:
POST https://peppol-senders.nl/api/senders/bulk_update_async/
Headers:
Authorization: Token <your auth token>
Content-Type: application/json
Accept: application/json
Post data:
[
{
"email": "example@ionite.net",
"iso6523_identifier": "1111122222",
"iso6523_scheme": 106,
"name": "Ionite"
},
{
"email": "example@example.nl",
"iso6523_identifier": "12345678",
"iso6523_scheme": 106,
"name": "Example Company 1",
"website": "badwebsite"
},
{
"email": "badaddress",
"iso6523_identifier": "00000001234561",
"iso6523_scheme": 190,
"name": "Example Company 1 Holding",
"website": null
},
{
"email": "example@example.net",
"iso6523_identifier": "12345678",
"iso6523_scheme": 106,
"name": "Example Company 2",
"updated_on": "2018-11-22T19:53:01.117287Z",
"website": "https://example.nl"
}
]
Response code: 202
Response data:
{
"active": true,
"created": 0,
"created_on": "2018-11-28T23:33:34.289058Z",
"errors": 0,
"finished_on": null,
"id": 27,
"requested": 4,
"updated": 0
}
Retrieve the status of the asynchronous bulk update
Method and endpoint:
GET https://peppol-senders.nl/api/senders/bulk_update_async/
Headers:
Accept: application/json
Content-Type: application/json
Authorization: Token <your auth token>
Post data:
No post data
Response code: 200
Response data:
{
"active": true,
"created": 0,
"created_on": "2018-11-28T23:33:34.289058Z",
"errors": 0,
"finished_on": null,
"id": 27,
"requested": 4,
"updated": 2
}
Retrieve the report of the last asynchronous bulk update
Method and endpoint:
GET https://peppol-senders.nl/api/senders/bulk_update_async_report/
Headers:
Accept: application/json
Authorization: Token <your auth token>
Content-Type: application/json
Post data:
No post data
Response code: 200
Response data:
{
"data": [
{
"created": false,
"index": 0,
"input_data": {
"email": "example@ionite.net",
"iso6523_identifier": "1111122222",
"iso6523_scheme": 106,
"name": "Ionite"
},
"saved_data": {
"api_url": "http://testserver/api/senders/5029/",
"created_on": "2018-11-28T23:28:48.581168Z",
"email": "example@ionite.net",
"email_verified": true,
"id": 5029,
"iso6523_identifier": "1111122222",
"iso6523_scheme": 106,
"iso6523_verified": true,
"name": "Ionite",
"updated_on": "2018-11-28T23:37:34.575848Z",
"website": null
},
"success": true
},
{
"created": false,
"errors": {
"website": [
"Enter a valid URL."
]
},
"index": 1,
"input_data": {
"email": "example@example.nl",
"iso6523_identifier": "12345678",
"iso6523_scheme": 106,
"name": "Example Company 1",
"website": "badwebsite"
},
"success": false
},
{
"created": false,
"errors": {
"email": [
"Enter a valid email address."
]
},
"index": 2,
"input_data": {
"email": "badaddress",
"iso6523_identifier": "00000001234561",
"iso6523_scheme": 190,
"name": "Example Company 1 Holding",
"website": null
},
"success": false
},
{
"created": false,
"index": 3,
"input_data": {
"email": "example@example.net",
"iso6523_identifier": "12345678",
"iso6523_scheme": 106,
"name": "Example Company 2",
"updated_on": "2018-11-22T19:53:01.117287Z",
"website": "https://example.nl"
},
"saved_data": {
"api_url": "http://testserver/api/senders/5030/",
"created_on": "2018-11-28T23:28:48.603156Z",
"email": "example@example.net",
"email_verified": true,
"id": 5030,
"iso6523_identifier": "12345678",
"iso6523_scheme": 106,
"iso6523_verified": true,
"name": "Example Company 2",
"updated_on": "2018-11-28T23:37:34.734758Z",
"website": "https://example.nl"
},
"success": true
}
],
"entries_created": 0,
"entries_updated": 2,
"errors": 2
}