Get a Consumer
curl --request GET \
--url https://api.sequin.io/v1/http-consumers/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequin.io/v1/http-consumers/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequin.io/v1/http-consumers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sequin.io/v1/http-consumers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sequin.io/v1/http-consumers/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sequin.io/v1/http-consumers/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequin.io/v1/http-consumers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "c906b4a4-0cda-4f46-bd80-255f570c195d",
"stream_id": "f0f70b52-5243-489c-879b-a1ae3f02abfd",
"deliver_policy": "all",
"ack_wait_ms": 30000,
"max_deliver": -1,
"max_ack_pending": 1000,
"name": "Choam Corp - Primary Consumer",
"metadata": { "custom_property": 42 },
"created_at": "2023-12-15 01:29:29",
"updated_at": "2023-12-15 01:29:29"
}
Consumers
Get a Consumer
This endpoint gets a single consumer.
GET
/
v1
/
http-consumers
/
{id}
Get a Consumer
curl --request GET \
--url https://api.sequin.io/v1/http-consumers/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequin.io/v1/http-consumers/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequin.io/v1/http-consumers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sequin.io/v1/http-consumers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sequin.io/v1/http-consumers/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sequin.io/v1/http-consumers/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequin.io/v1/http-consumers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "c906b4a4-0cda-4f46-bd80-255f570c195d",
"stream_id": "f0f70b52-5243-489c-879b-a1ae3f02abfd",
"deliver_policy": "all",
"ack_wait_ms": 30000,
"max_deliver": -1,
"max_ack_pending": 1000,
"name": "Choam Corp - Primary Consumer",
"metadata": { "custom_property": 42 },
"created_at": "2023-12-15 01:29:29",
"updated_at": "2023-12-15 01:29:29"
}
Request parameters
Response fields
{
"id": "c906b4a4-0cda-4f46-bd80-255f570c195d",
"stream_id": "f0f70b52-5243-489c-879b-a1ae3f02abfd",
"deliver_policy": "all",
"ack_wait_ms": 30000,
"max_deliver": -1,
"max_ack_pending": 1000,
"name": "Choam Corp - Primary Consumer",
"metadata": { "custom_property": 42 },
"created_at": "2023-12-15 01:29:29",
"updated_at": "2023-12-15 01:29:29"
}
Where in the stream the consumer starts.
all(default): the consumer will start from the beginning of the stream.new: the consumer will start from the most recent message.last: the consumer will start from the last message it received.1h: the consumer will start from the most recent message from the last hour.
How long to wait for a message to be acknowledged, in milliseconds. Defaults to
30000 (30 seconds).If a worker doesn’t acknowledge a message within this time, the message will be redelivered (i.e. reappear for other workers to process).Maximum number of times a message can be redelivered to workers. For example, if a message causes your workers to crash, it will be redelivered up to
max_deliver times before being discarded.Defaults to -1, which means there is no maximum.Maximum number of outstanding, acknowledged messages a consumer will allow at a time. Defaults to
1000.After your workers have checked out max_ack_pending messages, the consumer will stop delivering messages until some are acknowledged.Metadata for the sync. This is a JSON object that you can use to store any additional information you want to associate with the sync.

