Reply in a conversation
curl --request POST \
--url https://api.nylon.dev/v1/inbox/conversations/{conversationId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "We do — shipping is free over €50."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: 'We do — shipping is free over €50.'})
};
fetch('https://api.nylon.dev/v1/inbox/conversations/{conversationId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nylon.dev/v1/inbox/conversations/{conversationId}/messages"
payload = { "text": "We do — shipping is free over €50." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nylon.dev/v1/inbox/conversations/{conversationId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'We do — shipping is free over €50.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.nylon.dev/v1/inbox/conversations/{conversationId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"We do — shipping is free over €50.\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"conversation_id": "<string>",
"direction": "inbound",
"sent_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"text": "<string>",
"attachments": [
{}
],
"author": {
"id": "<string>",
"name": "<string>"
},
"edited_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"read_at": "2023-11-07T05:31:56Z",
"reactions": [
{
"from": "<string>",
"emoji": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "The request body is not valid.",
"details": [
{
"field": "profile_ids",
"message": "Address the post to at least one profile."
}
]
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required."
}
}{
"error": {
"code": "not_found",
"message": "Post could not be found."
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required.",
"details": [
{
"message": "Instagram requires at least 1 media item — text-only posts are not supported.",
"field": "profile_ids",
"network": "instagram",
"code": "invalid_request"
}
]
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after the window resets."
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required.",
"details": [
{
"message": "Instagram requires at least 1 media item — text-only posts are not supported.",
"field": "profile_ids",
"network": "instagram",
"code": "invalid_request"
}
]
}
}Inbox
Reply in a conversation
Answer a DM privately or a comment publicly, with one call.
POST
https://api.nylon.dev
/
v1
/
inbox
/
conversations
/
{conversationId}
/
messages
Reply in a conversation
curl --request POST \
--url https://api.nylon.dev/v1/inbox/conversations/{conversationId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "We do — shipping is free over €50."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: 'We do — shipping is free over €50.'})
};
fetch('https://api.nylon.dev/v1/inbox/conversations/{conversationId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nylon.dev/v1/inbox/conversations/{conversationId}/messages"
payload = { "text": "We do — shipping is free over €50." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nylon.dev/v1/inbox/conversations/{conversationId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'We do — shipping is free over €50.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.nylon.dev/v1/inbox/conversations/{conversationId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"We do — shipping is free over €50.\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"conversation_id": "<string>",
"direction": "inbound",
"sent_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"text": "<string>",
"attachments": [
{}
],
"author": {
"id": "<string>",
"name": "<string>"
},
"edited_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"read_at": "2023-11-07T05:31:56Z",
"reactions": [
{
"from": "<string>",
"emoji": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "The request body is not valid.",
"details": [
{
"field": "profile_ids",
"message": "Address the post to at least one profile."
}
]
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required."
}
}{
"error": {
"code": "not_found",
"message": "Post could not be found."
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required.",
"details": [
{
"message": "Instagram requires at least 1 media item — text-only posts are not supported.",
"field": "profile_ids",
"network": "instagram",
"code": "invalid_request"
}
]
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after the window resets."
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required.",
"details": [
{
"message": "Instagram requires at least 1 media item — text-only posts are not supported.",
"field": "profile_ids",
"network": "instagram",
"code": "invalid_request"
}
]
}
}Authorizations
An API key beginning with nylon_live_.
Path Parameters
The Nylon id of the conversation.
Example:
"cly8a1b2c0001x8b3d4e5f0gg"
Body
application/json
What to send. Public on a comment thread, private on a direct message.
Maximum string length:
10000Response
The message as it now sits in the thread.
Hide child attributes
Hide child attributes
outbound covers replies sent through Nylon and from the network's own app.
Available options:
inbound, outbound The message's id on the network.
Set when the sender unsent it. The text is cleared and the message kept, so the thread does not lose its shape.
⌘I