-
Notifications
You must be signed in to change notification settings - Fork 0
Import Feedback
James Williamson edited this page Aug 10, 2018
·
2 revisions
Every time an Import is started its given a new ID. This ID can be used to retrieve information about an on-going or finished import.
The ID (also called internal_reference) is in the format of a GUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
Using this ID you can retrieve a summary about an Import. The url below is an example of how to do this.
GET /api/v1/admin/{{company_id}}/imports/{{ID}}
{
"internal_reference": "ae83c742-406b-4be6-b3c8-141a8122a920",
"feed_name": "The corporation",
"created_at": "2018-08-09T10:53:41Z",
"started_at": "2018-08-09T10:53:41Z",
"completed_at": "2018-08-09T10:53:57Z",
"status": "completed",
"objects_to_import": 34,
"objects_imported": 32
}
## Feedback on objects within an Import
You can also get feedback on each object that as imported. This includes a _status_ of what happened to the object. The _object_type_ to state what the object was. And the _object_external_id_ to link to back to the external_id of the object.
`GET /imports/:id/objects`
```JSON
{
"total_entries": 14,
"_embedded": {
"objects": [{
"status": "created",
"object_type": "user",
"object_external_id": "ab2298"
}, {
"status": "updated",
"object_type": "user",
"object_external_id": "ah0605"
}, {
"status": "failed",
"object_type": "user",
"object_external_id": "ashgreen",
"errors": ["not imported as it is marked as deleted"]
}, {
"status": "failed",
"object_type": "user",
"object_external_id": "ba00692",
"errors": ["None of the companies have been imported yet"],
"warnings": ["One of the companies has not been imported yet"]
}, {
"status": "failed",
"object_type": "user",
"object_external_id": "ba00957",
"errors": ["not imported as it is marked as deleted"]
}]
}
}- created - A new object was created in BookingBug for data in the feed
- updated - Bookingbug was updated with data from the feed
- skipped - No update needed. Most likely the last_modified was greater in BookingBug
- failed - Object was not updated because a piece of data was invalid
- error - Something went wrong inside BookingBug while trying to preform the update
Sometimes you are going to want to search for particular objects rather than get all of them back. To do this you can use one of the follow parameters to filter the list.
- object_types[] - To filter for specific types. Eg person, company
- statuses[] - To filter for statuses. Eg created, updated
Pagination of the objects can be done with two parameters.
- page - What page. Starts at 1.
- per_page - Number of items to return for each page. Default to 1000
Using the url below you can retrieve a list of Imports.
GET /api/v1/admin/{{company_id}}/imports
{
"total_entries": 3,
"_embedded": {
"imports": [{
"internal_reference": "0e659d0c-d61d-40d7-900c-45213cd1c427",
"feed_name": "The corporation",
"created_at": "2018-07-20T12:14:39Z",
"started_at": "2018-07-20T12:14:39Z",
"completed_at": "2018-07-20T12:14:42Z",
"status": "completed_with_issues",
"objects_to_import": 14,
"objects_imported": 11
},
{
"internal_reference": "0e0128d0d-e71d-15d7-900c-82713kd1c474",
"feed_name": "The other corporation",
"created_at": "2018-07-25T12:14:39Z",
"started_at": "2018-07-25T12:14:39Z",
"completed_at": "2018-07-25T12:14:42Z",
"status": "completed",
"objects_to_import": 8,
"objects_imported": 8
}]
}
}