Skip to content

Commit

Permalink
Updated response object examples in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ciminelli committed Dec 29, 2023
1 parent aaa7401 commit 0a8f344
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 101 deletions.
12 changes: 6 additions & 6 deletions docs/api-reference/get-import-rows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ To use the limit/offset, start by setting the offset to 0 and the limit to 100 t
{
"index": 0,
"values": {
"email": "[email protected]",
"first_name": "Laura",
"last_name": "Smith"
"age": 23,
"email": "[email protected]",
"first_name": "Maria"
}
},
{
"index": 1,
"values": {
"email": "[email protected]",
"first_name": "Craig",
"last_name": "Johnson"
"age": 32,
"email": "[email protected]",
"first_name": "Robert"
}
}
]
Expand Down
35 changes: 20 additions & 15 deletions docs/api-reference/get-import.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@ Retrieve the row data, column definitions, and other information about the impor
```json
{
"id": "da5554e3-6c87-41b2-9366-5449a2f15b53",
"importer_id": "6de452a2-bd1f-4cb3-b29b-0f8a2e3d9353",
"created_at": 1703791355,
"importer_id": "a0fadb1d-9888-4fcb-b185-25b984bcb227",
"num_rows": 2,
"num_columns": 3,
"num_processed_values": 5,
"num_rows": 2,
"metadata": {},
"metadata": {
"user_id": 1234,
"user_email": "[email protected]",
"environment": "staging"
},
"created_at": 1698172312,
"error": null,
"columns": [
{
"data_type": "number",
"key": "age",
"name": "Age"
},
{
"data_type": "string",
"key": "email",
Expand All @@ -29,28 +39,23 @@ Retrieve the row data, column definitions, and other information about the impor
"data_type": "string",
"key": "first_name",
"name": "First Name"
},
{
"data_type": "string",
"key": "last_name",
"name": "Last Name"
}
],
"rows": [
{
"index": 0,
"values": {
"email": "[email protected]",
"first_name": "Laura",
"last_name": "Smith"
"age": 23,
"email": "[email protected]",
"first_name": "Maria"
}
},
{
"index": 1,
"values": {
"email": "[email protected]",
"first_name": "Craig",
"last_name": "Johnson"
"age": 32,
"email": "[email protected]",
"first_name": "Robert"
}
}
]
Expand Down
74 changes: 34 additions & 40 deletions docs/sdk/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -302,68 +302,62 @@ uploadButton.addEventListener("click", () => {
</ResponseField>
<ResponseField name="onComplete" type="function">
Callback function that fires when a user completes an import. It returns `data`, an object that contains the row data
and information about the import such as the number of rows. The number of rows returned is limited to 10,000. If
there are more than 10,000 rows, an `error` will be set and the data should be retrieved using the
[API](/api-reference/get-import-rows).
Callback function that fires when a user completes an import. It returns `data`, an object that contains the row data,
column definitions, and other information about the import.
<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
the data should be retrieved using the [API](/api-reference/get-import-rows).</Info>
```jsx
onComplete={(data) => console.log(data)}
```
Example `data`:
```json
{
"id": "170f9ae1-c109-4e26-83a1-b31f2baa81b2",
"upload_id": "4f7ec0b5-16ef-4d0e-8b6a-0c182815a131",
"id": "da5554e3-6c87-41b2-9366-5449a2f15b53",
"importer_id": "a0fadb1d-9888-4fcb-b185-25b984bcb227",
"num_rows": 4,
"num_columns": 4,
"num_processed_values": 16,
"num_rows": 2,
"num_columns": 3,
"num_processed_values": 5,
"metadata": {
"user_id": 1234,
"user_email": "test@example.com",
"environment": "dev"
"user_id": 1234,
"user_email": "user@example.com",
"environment": "staging"
},
"is_stored": true,
"has_errors": false,
"num_error_rows": 0,
"num_valid_rows": 4,
"created_at": 1698172312,
"error": null,
"columns": [
{
"data_type": "number",
"key": "age",
"name": "Age"
},
{
"data_type": "string",
"key": "email",
"name": "Email"
},
{
"data_type": "string",
"key": "first_name",
"name": "First Name"
}
],
"rows": [
{
"index": 0,
"values": {
"age": "23",
"age": 23,
"email": "[email protected]",
"first_name": "Maria",
"last_name": "Martinez"
"first_name": "Maria"
}
},
{
"index": 1,
"values": {
"age": "32",
"age": 32,
"email": "[email protected]",
"first_name": "Robert",
"last_name": "Jones"
}
},
{
"index": 2,
"values": {
"age": "30",
"email": "[email protected]",
"first_name": "Mary",
"last_name": "Zhang"
}
},
{
"index": 3,
"values": {
"age": "24",
"email": "[email protected]",
"first_name": "Jamie",
"last_name": "Miller"
"first_name": "Robert"
}
}
]
Expand Down
74 changes: 34 additions & 40 deletions docs/sdk/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -256,68 +256,62 @@ function MyComponent() {
</ResponseField>
<ResponseField name="onComplete" type="function">
Callback function that fires when a user completes an import. It returns `data`, an object that contains the row data
and information about the import such as the number of rows. The number of rows returned is limited to 10,000. If
there are more than 10,000 rows, an `error` will be set and the data should be retrieved using the
[API](/api-reference/get-import-rows).
Callback function that fires when a user completes an import. It returns `data`, an object that contains the row data,
column definitions, and other information about the import.
<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
the data should be retrieved using the [API](/api-reference/get-import-rows).</Info>
```jsx
onComplete={(data) => console.log(data)}
```
Example `data`:
```json
{
"id": "170f9ae1-c109-4e26-83a1-b31f2baa81b2",
"upload_id": "4f7ec0b5-16ef-4d0e-8b6a-0c182815a131",
"id": "da5554e3-6c87-41b2-9366-5449a2f15b53",
"importer_id": "a0fadb1d-9888-4fcb-b185-25b984bcb227",
"num_rows": 4,
"num_columns": 4,
"num_processed_values": 16,
"num_rows": 2,
"num_columns": 3,
"num_processed_values": 5,
"metadata": {
"user_id": 1234,
"user_email": "test@example.com",
"environment": "dev"
"user_id": 1234,
"user_email": "user@example.com",
"environment": "staging"
},
"is_stored": true,
"has_errors": false,
"num_error_rows": 0,
"num_valid_rows": 4,
"created_at": 1698172312,
"error": null,
"columns": [
{
"data_type": "number",
"key": "age",
"name": "Age"
},
{
"data_type": "string",
"key": "email",
"name": "Email"
},
{
"data_type": "string",
"key": "first_name",
"name": "First Name"
}
],
"rows": [
{
"index": 0,
"values": {
"age": "23",
"age": 23,
"email": "[email protected]",
"first_name": "Maria",
"last_name": "Martinez"
"first_name": "Maria"
}
},
{
"index": 1,
"values": {
"age": "32",
"age": 32,
"email": "[email protected]",
"first_name": "Robert",
"last_name": "Jones"
}
},
{
"index": 2,
"values": {
"age": "30",
"email": "[email protected]",
"first_name": "Mary",
"last_name": "Zhang"
}
},
{
"index": 3,
"values": {
"age": "24",
"email": "[email protected]",
"first_name": "Jamie",
"last_name": "Miller"
"first_name": "Robert"
}
}
]
Expand Down

0 comments on commit 0a8f344

Please sign in to comment.