Success
Read successful API responses and paginated results.
Status Codes and Description
The following table explains the status codes for successful requests.
| Status Code | Description | Possible Response Schema | Body |
|---|---|---|---|
200OK |
When retrieving a resource | ResponseOk / ResponseWithPagination | Resource / Resources and pagination |
201 Created |
When creating a new resource | ResponseOk | Resource created |
204 No Content |
Updating or deleting a resource | ResponseNoContent | None |
Response Ok Schema
data
any
Data contains the response object
success
string
Status indicates the response status "success" Examples: "success"
{
"data": "<any>",
"status": "success"
}
Response With Pagination Schema
Lists of job, source, file, notification, and upload resources return paginated results.
The default and maximum page size is 100 items. Use pagination to retrieve additional results.
data
any
Data contains the paginated items
limit
integer
Limit indicates the maximum number of items in the current response
offset
integer
Offset indicates the offset of the first item in the current response
total
integer
Total indicates the total number of items
success
string
Status indicates the response status "success" Examples: "success"
{
"data": "<any>",
"limit": 20,
"offset": 0,
"status": "success",
"total": 154
}
Pagination use with our SDK
Use your SDK to retrieve paginated results:
import { createClient } from 'chunkify';
const client = createClient({
projectToken: 'your_token',
});
// List all the sources with limit 10
const paginatedResults = await client.source.list({
limit: 10,
});
// You can access the first page of result
console.log(paginatedResults.items);
// Or Iterate over the paginated results
for await (const page of paginatedResults) {
// Access the current page of sources
page.items.forEach((source) => {
console.log(source.id, source.url);
});
}