API reference
Retrieve an import
How to fetch a specific import via API
To fetch a single import, send a GET request to the /api/imports/:id endpoint, where id is the ID of the resource that you want to retrieve.

Request

GET https://yourdomain.commercelayer.io/api/imports/:id

Example

Request
Response
The following request fetches the import identified by the id "xYZkjABcde":
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/imports/xYZkjABcde' \
3
-H 'Accept: application/vnd.api+json' \
4
-H 'Authorization: Bearer your-access-token'
Copied!
On success, the API responds with a 200 OK status code, returning a single resource object:
1
{
2
"data": {
3
"id": "xYZkjABcde",
4
"type": "imports",
5
"links": {
6
"self": "https://yourdomain.commercelayer.io/api/imports/xYZkjABcde"
7
},
8
"attributes": {
9
"resource_type": "skus",
10
"parent_resource_id": "1234",
11
"status": "in_progress",
12
"started_at": "2018-01-01T12:00:00.000Z",
13
"completed_at": "2018-01-01T12:00:00.000Z",
14
"interrupted_at": "2018-01-01T12:00:00.000Z",
15
"inputs": [
16
{
17
"code": "ABC",
18
"name": "Foo"
19
},
20
{
21
"code": "DEF",
22
"name": "Bar"
23
}
24
],
25
"inputs_size": 300,
26
"errors_count": 30,
27
"warnings_count": 1,
28
"destroyed_count": 99,
29
"processed_count": 270,
30
"errors_log": {
31
"ABC": {
32
"name": [
33
"has already been taken"
34
]
35
}
36
},
37
"warnings_log": {
38
"ABC": [
39
"could not be deleted"
40
]
41
},
42
"cleanup_records": true,
43
"created_at": "2018-01-01T12:00:00.000Z",
44
"updated_at": "2018-01-01T12:00:00.000Z",
45
"reference": "ANY-EXTERNAL-REFEFERNCE",
46
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
47
"metadata": {
48
"foo": "bar"
49
}
50
},
51
"relationships": {
52
"events": {
53
"links": {
54
"self": "https://yourdomain.commercelayer.io/api/imports/xYZkjABcde/relationships/events",
55
"related": "https://yourdomain.commercelayer.io/api/imports/xYZkjABcde/events"
56
}
57
}
58
},
59
"meta": {
60
"mode": "test"
61
}
62
}
63
}
Copied!
Copy link