API reference
List sync rejections
List the records a sync refused, or the values it dropped, one page at a time.
Generated from /openapi.json.
Request
GEThttps://www.postaged.com/api/integrations/push/v1/sync/rejections
The records a sync refused, or with type=warning the values it dropped from accepted records, one page at a time. Pass nextAfter back as after until it is null.
curl https://www.postaged.com/api/integrations/push/v1/sync/rejections \
-H "Authorization: Bearer $POSTAGED_API_KEY"const response = await fetch("https://www.postaged.com/api/integrations/push/v1/sync/rejections", {
headers: {
Authorization: `Bearer ${process.env.POSTAGED_API_KEY}`,
},
});
const result = await response.json();
console.log(result);import os
import requests
response = requests.get(
"https://www.postaged.com/api/integrations/push/v1/sync/rejections",
headers={"Authorization": f"Bearer {os.environ['POSTAGED_API_KEY']}"},
timeout=60,
)
print(response.json())Authentication
An integration key (it starts with pk_int_), created with New key on the integration's page. Send it in the Authorization: Bearer header. Only that integration's key works here; any other key gets 401 invalid_key.
Headers
Authorization: Bearer $POSTAGED_API_KEY
Content-Type: application/jsonParameters
- syncIdstring (query)OptionalThe sync to read. Leave it out to read the latest sync.
- typestring (query)OptionalOne of
rejectionorwarning. Defaultrejection. - afterstring (query)OptionalThe nextAfter value of the previous page.
- limitinteger (query)Optional1 to 1,000. Default
100.
Response 200
One page of issues.
- syncIdstring
- typestringOne of
rejectionorwarning. - itemsarray of objects
- idinteger
- batchinteger
- indexinteger
- externalIdstring or null
- codestringA rejection code, or invalid_type for a dropped value.
- fieldstring or null
- messagestring
- nextAfterstring or nullPass it back as after for the next page. Null on the last page.
Response200 OK
{
"syncId": "0b6f3c3e-8d2a-4f7e-9a51-2c4d8e6f1a20",
"type": "rejection",
"items": [
{
"id": 7,
"batch": 1,
"index": 3,
"externalId": "crm-1077",
"code": "invalid_email",
"field": "email",
"message": "\"email\" does not look like an email address."
}
],
"nextAfter": null
}Errors
Errors use the body { "error": { "code", "message", "details" } }; details appears only on some codes. Full tables: Error reference.
| Status | code | message | What to do |
|---|---|---|---|
| 400 | invalid_sync_id | syncId must be the id a sync call returned. | Fix the query parameter the message names: syncId is a sync id from a sync call, type is rejection or warning, after is the previous page's nextAfter, and limit is a whole number in range. |
| 400 | invalid_type | type must be "rejection" or "warning". | Fix the query parameter the message names: syncId is a sync id from a sync call, type is rejection or warning, after is the previous page's nextAfter, and limit is a whole number in range. |
| 400 | invalid_cursor | after must be the nextAfter value of the previous page. | Fix the query parameter the message names: syncId is a sync id from a sync call, type is rejection or warning, after is the previous page's nextAfter, and limit is a whole number in range. |
| 400 | invalid_limit | limit must be a whole number from 1 to 1000. | Fix the query parameter the message names: syncId is a sync id from a sync call, type is rejection or warning, after is the previous page's nextAfter, and limit is a whole number in range. |
| 401 | invalid_key | That API key is not valid for this integration. | Send this integration's key (it starts with pk_int_) in the Authorization: Bearer header. A revoked key, another kind of key, or a key for a removed integration gets this error. |
| 403 | integration_unavailable | This integration is not accepting data. Contact support if you think that is wrong. | The integration is paused or disconnected in Postaged. Ask the owner to resume it, then send the request again. |
| 404 | sync_not_found | There is no sync with that id on this integration. | Use a syncId this integration's sync calls returned, or leave it out to read the latest sync. |
| 429 | rate_limited | Too many requests. Slow down and retry. | Wait the number of seconds in the Retry-After header, then send the request again. |
invalid_sync_id400
{
"error": {
"code": "invalid_sync_id",
"message": "syncId must be the id a sync call returned."
}
}invalid_type400
{
"error": {
"code": "invalid_type",
"message": "type must be \"rejection\" or \"warning\"."
}
}invalid_cursor400
{
"error": {
"code": "invalid_cursor",
"message": "after must be the nextAfter value of the previous page."
}
}invalid_limit400
{
"error": {
"code": "invalid_limit",
"message": "limit must be a whole number from 1 to 1000."
}
}invalid_key401
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="Postaged"
{
"error": {
"code": "invalid_key",
"message": "That API key is not valid for this integration."
}
}integration_unavailable403
{
"error": {
"code": "integration_unavailable",
"message": "This integration is not accepting data. Contact support if you think that is wrong."
}
}sync_not_found404
{
"error": {
"code": "sync_not_found",
"message": "There is no sync with that id on this integration."
}
}rate_limited429
HTTP/1.1 429 Too Many Requests
Retry-After: 60
{
"error": {
"code": "rate_limited",
"message": "Too many requests. Slow down and retry."
}
}