Skip to content

Commit 0a8f344

Browse files
committed
Updated response object examples in docs
1 parent aaa7401 commit 0a8f344

File tree

4 files changed

+94
-101
lines changed

4 files changed

+94
-101
lines changed

docs/api-reference/get-import-rows.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ To use the limit/offset, start by setting the offset to 0 and the limit to 100 t
1616
{
1717
"index": 0,
1818
"values": {
19-
"email": "[email protected]",
20-
"first_name": "Laura",
21-
"last_name": "Smith"
19+
"age": 23,
20+
"email": "[email protected]",
21+
"first_name": "Maria"
2222
}
2323
},
2424
{
2525
"index": 1,
2626
"values": {
27-
"email": "[email protected]",
28-
"first_name": "Craig",
29-
"last_name": "Johnson"
27+
"age": 32,
28+
"email": "[email protected]",
29+
"first_name": "Robert"
3030
}
3131
}
3232
]

docs/api-reference/get-import.mdx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,23 @@ Retrieve the row data, column definitions, and other information about the impor
1313
```json
1414
{
1515
"id": "da5554e3-6c87-41b2-9366-5449a2f15b53",
16-
"importer_id": "6de452a2-bd1f-4cb3-b29b-0f8a2e3d9353",
17-
"created_at": 1703791355,
16+
"importer_id": "a0fadb1d-9888-4fcb-b185-25b984bcb227",
17+
"num_rows": 2,
1818
"num_columns": 3,
1919
"num_processed_values": 5,
20-
"num_rows": 2,
21-
"metadata": {},
20+
"metadata": {
21+
"user_id": 1234,
22+
"user_email": "[email protected]",
23+
"environment": "staging"
24+
},
25+
"created_at": 1698172312,
26+
"error": null,
2227
"columns": [
28+
{
29+
"data_type": "number",
30+
"key": "age",
31+
"name": "Age"
32+
},
2333
{
2434
"data_type": "string",
2535
"key": "email",
@@ -29,28 +39,23 @@ Retrieve the row data, column definitions, and other information about the impor
2939
"data_type": "string",
3040
"key": "first_name",
3141
"name": "First Name"
32-
},
33-
{
34-
"data_type": "string",
35-
"key": "last_name",
36-
"name": "Last Name"
3742
}
3843
],
3944
"rows": [
4045
{
4146
"index": 0,
4247
"values": {
43-
"email": "[email protected]",
44-
"first_name": "Laura",
45-
"last_name": "Smith"
48+
"age": 23,
49+
"email": "[email protected]",
50+
"first_name": "Maria"
4651
}
4752
},
4853
{
4954
"index": 1,
5055
"values": {
51-
"email": "[email protected]",
52-
"first_name": "Craig",
53-
"last_name": "Johnson"
56+
"age": 32,
57+
"email": "[email protected]",
58+
"first_name": "Robert"
5459
}
5560
}
5661
]

docs/sdk/javascript.mdx

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -302,68 +302,62 @@ uploadButton.addEventListener("click", () => {
302302
</ResponseField>
303303
304304
<ResponseField name="onComplete" type="function">
305-
Callback function that fires when a user completes an import. It returns `data`, an object that contains the row data
306-
and information about the import such as the number of rows. The number of rows returned is limited to 10,000. If
307-
there are more than 10,000 rows, an `error` will be set and the data should be retrieved using the
308-
[API](/api-reference/get-import-rows).
305+
Callback function that fires when a user completes an import. It returns `data`, an object that contains the row data,
306+
column definitions, and other information about the import.
307+
308+
<Info>The number of rows included is limited to 10,000. If there are more than 10,000 rows, an `error` will be set and
309+
the data should be retrieved using the [API](/api-reference/get-import-rows).</Info>
310+
309311
```jsx
310312
onComplete={(data) => console.log(data)}
311313
```
312314
Example `data`:
313315
```json
314316
{
315-
"id": "170f9ae1-c109-4e26-83a1-b31f2baa81b2",
316-
"upload_id": "4f7ec0b5-16ef-4d0e-8b6a-0c182815a131",
317+
"id": "da5554e3-6c87-41b2-9366-5449a2f15b53",
317318
"importer_id": "a0fadb1d-9888-4fcb-b185-25b984bcb227",
318-
"num_rows": 4,
319-
"num_columns": 4,
320-
"num_processed_values": 16,
319+
"num_rows": 2,
320+
"num_columns": 3,
321+
"num_processed_values": 5,
321322
"metadata": {
322-
"user_id": 1234,
323-
"user_email": "test@example.com",
324-
"environment": "dev"
323+
"user_id": 1234,
324+
"user_email": "user@example.com",
325+
"environment": "staging"
325326
},
326-
"is_stored": true,
327-
"has_errors": false,
328-
"num_error_rows": 0,
329-
"num_valid_rows": 4,
330327
"created_at": 1698172312,
331328
"error": null,
329+
"columns": [
330+
{
331+
"data_type": "number",
332+
"key": "age",
333+
"name": "Age"
334+
},
335+
{
336+
"data_type": "string",
337+
"key": "email",
338+
"name": "Email"
339+
},
340+
{
341+
"data_type": "string",
342+
"key": "first_name",
343+
"name": "First Name"
344+
}
345+
],
332346
"rows": [
333347
{
334348
"index": 0,
335349
"values": {
336-
"age": "23",
350+
"age": 23,
337351
"email": "[email protected]",
338-
"first_name": "Maria",
339-
"last_name": "Martinez"
352+
"first_name": "Maria"
340353
}
341354
},
342355
{
343356
"index": 1,
344357
"values": {
345-
"age": "32",
358+
"age": 32,
346359
"email": "[email protected]",
347-
"first_name": "Robert",
348-
"last_name": "Jones"
349-
}
350-
},
351-
{
352-
"index": 2,
353-
"values": {
354-
"age": "30",
355-
"email": "[email protected]",
356-
"first_name": "Mary",
357-
"last_name": "Zhang"
358-
}
359-
},
360-
{
361-
"index": 3,
362-
"values": {
363-
"age": "24",
364-
"email": "[email protected]",
365-
"first_name": "Jamie",
366-
"last_name": "Miller"
360+
"first_name": "Robert"
367361
}
368362
}
369363
]

docs/sdk/react.mdx

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -256,68 +256,62 @@ function MyComponent() {
256256
</ResponseField>
257257

258258
<ResponseField name="onComplete" type="function">
259-
Callback function that fires when a user completes an import. It returns `data`, an object that contains the row data
260-
and information about the import such as the number of rows. The number of rows returned is limited to 10,000. If
261-
there are more than 10,000 rows, an `error` will be set and the data should be retrieved using the
262-
[API](/api-reference/get-import-rows).
259+
Callback function that fires when a user completes an import. It returns `data`, an object that contains the row data,
260+
column definitions, and other information about the import.
261+
262+
<Info>The number of rows included is limited to 10,000. If there are more than 10,000 rows, an `error` will be set and
263+
the data should be retrieved using the [API](/api-reference/get-import-rows).</Info>
264+
263265
```jsx
264266
onComplete={(data) => console.log(data)}
265267
```
266268
Example `data`:
267269
```json
268270
{
269-
"id": "170f9ae1-c109-4e26-83a1-b31f2baa81b2",
270-
"upload_id": "4f7ec0b5-16ef-4d0e-8b6a-0c182815a131",
271+
"id": "da5554e3-6c87-41b2-9366-5449a2f15b53",
271272
"importer_id": "a0fadb1d-9888-4fcb-b185-25b984bcb227",
272-
"num_rows": 4,
273-
"num_columns": 4,
274-
"num_processed_values": 16,
273+
"num_rows": 2,
274+
"num_columns": 3,
275+
"num_processed_values": 5,
275276
"metadata": {
276-
"user_id": 1234,
277-
"user_email": "test@example.com",
278-
"environment": "dev"
277+
"user_id": 1234,
278+
"user_email": "user@example.com",
279+
"environment": "staging"
279280
},
280-
"is_stored": true,
281-
"has_errors": false,
282-
"num_error_rows": 0,
283-
"num_valid_rows": 4,
284281
"created_at": 1698172312,
285282
"error": null,
283+
"columns": [
284+
{
285+
"data_type": "number",
286+
"key": "age",
287+
"name": "Age"
288+
},
289+
{
290+
"data_type": "string",
291+
"key": "email",
292+
"name": "Email"
293+
},
294+
{
295+
"data_type": "string",
296+
"key": "first_name",
297+
"name": "First Name"
298+
}
299+
],
286300
"rows": [
287301
{
288302
"index": 0,
289303
"values": {
290-
"age": "23",
304+
"age": 23,
291305
"email": "[email protected]",
292-
"first_name": "Maria",
293-
"last_name": "Martinez"
306+
"first_name": "Maria"
294307
}
295308
},
296309
{
297310
"index": 1,
298311
"values": {
299-
"age": "32",
312+
"age": 32,
300313
"email": "[email protected]",
301-
"first_name": "Robert",
302-
"last_name": "Jones"
303-
}
304-
},
305-
{
306-
"index": 2,
307-
"values": {
308-
"age": "30",
309-
"email": "[email protected]",
310-
"first_name": "Mary",
311-
"last_name": "Zhang"
312-
}
313-
},
314-
{
315-
"index": 3,
316-
"values": {
317-
"age": "24",
318-
"email": "[email protected]",
319-
"first_name": "Jamie",
320-
"last_name": "Miller"
314+
"first_name": "Robert"
321315
}
322316
}
323317
]

0 commit comments

Comments
 (0)