curl --request POST \
--url https://api.sequin.io/v1/http-consumers/c906b4a4-0cda-4f46-bd80-255f570c195d/next \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
-d '{ "batch_size": 10 }'
curl --request GET \
--url https://api.sequin.io/v1/http-consumers/c906b4a4-0cda-4f46-bd80-255f570c195d/next?batch_size=10 \
--header 'Authorization: Bearer YOUR_API_TOKEN'
{
"data": [
{
"ack_token": "MTYyeJ7abUjl1pO",
"record": {
"id": "aa9a329d-c3cb-4dea-9ea4-42e99cfc08d7",
"collection_id": "salesforce:contact",
"resource_id": "7d522b89-b092-40ec-9016-e69b81b5b317",
"data": {
"FirstName": "Paul",
"LastName": "Atreides",
// rest of payload...
}
// rest of record...
}
},
// more messages...
],
"info": {
"num_pending": 100,
"num_ack_pending": 10
}
}
Consume
Get next messages
Get the next messages for an HTTP stream consumer
POST
/
v1
/
http-consumers
/
{id}
/
next
curl --request POST \
--url https://api.sequin.io/v1/http-consumers/c906b4a4-0cda-4f46-bd80-255f570c195d/next \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
-d '{ "batch_size": 10 }'
curl --request GET \
--url https://api.sequin.io/v1/http-consumers/c906b4a4-0cda-4f46-bd80-255f570c195d/next?batch_size=10 \
--header 'Authorization: Bearer YOUR_API_TOKEN'
{
"data": [
{
"ack_token": "MTYyeJ7abUjl1pO",
"record": {
"id": "aa9a329d-c3cb-4dea-9ea4-42e99cfc08d7",
"collection_id": "salesforce:contact",
"resource_id": "7d522b89-b092-40ec-9016-e69b81b5b317",
"data": {
"FirstName": "Paul",
"LastName": "Atreides",
// rest of payload...
}
// rest of record...
}
},
// more messages...
],
"info": {
"num_pending": 100,
"num_ack_pending": 10
}
}
You can use either
POST or GET to retrieve messages for an HTTP stream consumer.Request parameters
string
required
ID of the consumer.
integer
Number of messages to try to fetch from the consumer. Defaults to
1.The count of returned messages may be less than the requested batch size if there are fewer messages available for the consumer.integer
Amount of time to wait for messages to become available in the consumer, in milliseconds. Defaults to
0.When wait_for is greater than 0, the request will block until either batch_size messages are available or wait_for milliseconds have passed.Therefore, you can use wait_for to implement long polling.Response fields
The response is an object with adata property that contains a list of messages.
list
object
curl --request POST \
--url https://api.sequin.io/v1/http-consumers/c906b4a4-0cda-4f46-bd80-255f570c195d/next \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
-d '{ "batch_size": 10 }'
curl --request GET \
--url https://api.sequin.io/v1/http-consumers/c906b4a4-0cda-4f46-bd80-255f570c195d/next?batch_size=10 \
--header 'Authorization: Bearer YOUR_API_TOKEN'
{
"data": [
{
"ack_token": "MTYyeJ7abUjl1pO",
"record": {
"id": "aa9a329d-c3cb-4dea-9ea4-42e99cfc08d7",
"collection_id": "salesforce:contact",
"resource_id": "7d522b89-b092-40ec-9016-e69b81b5b317",
"data": {
"FirstName": "Paul",
"LastName": "Atreides",
// rest of payload...
}
// rest of record...
}
},
// more messages...
],
"info": {
"num_pending": 100,
"num_ack_pending": 10
}
}

