Biklo for developersTESTsandbox-api.biklo.comchange

Sandbox: have a buyer write to you

POST/v1/sandbox/messages

scope messages.writesandbox only — 404 in production

Sandbox only. Buyers are the ones who START conversations and the sandbox has none, so without this your inbox is permanently empty. A synthetic buyer opens (or continues) a conversation about one of your own listings, through the same write path a real buyer uses.

Request body#

FieldTypeRequiredDescription
product_idintegeroptionalWhich of your listings the buyer writes about. Send this or external_id; one that is not yours gives product_not_found (404). Writing about the same listing again CONTINUES the existing conversation rather than opening a second one.
external_idstringoptionalThe same choice by your own product id.
bodystringoptionalWhat the buyer says. Defaults to "Hello — is this still available?" if omitted or blank. The message goes through the same write path a real buyer uses, so it appears in GET /v1/threads exactly as a real one would.

Example

{
    "product_id": 237233,
    "body": "Is this still available?"
}

Response#

FieldTypeDescription
dataobjectWhat the synthetic buyer sent.
data.thread_idintegerThe conversation it landed in — a new one, or the existing one for that listing. Use it with GET /v1/threads/{id}/messages.
data.message_idintegerThe message id.
data.product_idintegerWhich of your listings it is about.
data.fromstringAlways buyer — that is the point of this endpoint.
data.bodystringWhat was sent, after the same chat-protection scan a real buyer's message gets.

Example

{
    "data": {
        "thread_id": 107373,
        "message_id": 174420,
        "product_id": 237233,
        "from": "buyer",
        "body": "Is this still available?"
    }
}

Failures use the shared error envelope — a machine-readable code and a request_id to quote to support. Error handling.

curl -X POST "https://sandbox-api.biklo.com/v1/sandbox/messages" \
  -H "Authorization: Bearer bk_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": 237233,
    "body": "Is this still available?"
}'
<?php

$ch = curl_init('https://sandbox-api.biklo.com/v1/sandbox/messages');

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer bk_test_YOUR_KEY',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
      'product_id' => 237233,
      'body' => 'Is this still available?',
    ]),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
using System.Net.Http;
using System.Net.Http.Headers;

var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "bk_test_YOUR_KEY");

var request = new HttpRequestMessage(
    new HttpMethod("POST"),
    "https://sandbox-api.biklo.com/v1/sandbox/messages");

request.Content = new StringContent(
    @"{ ""product_id"": 237233, ""body"": ""Is this still available?"" }",
    System.Text.Encoding.UTF8,
    "application/json");

var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
import requests

response = requests.post(
    "https://sandbox-api.biklo.com/v1/sandbox/messages",
    headers={"Authorization": "Bearer bk_test_YOUR_KEY"},
    json={
        "product_id": 237233,
        "body": "Is this still available?"
    },
)

data = response.json()
const response = await fetch("https://sandbox-api.biklo.com/v1/sandbox/messages", {
  method: "POST",
  headers: {
    Authorization: "Bearer bk_test_YOUR_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
      "product_id": 237233,
      "body": "Is this still available?"
  })
});

const data = await response.json();
import java.net.http.*;
import java.net.URI;

var client = HttpClient.newHttpClient();

var request = HttpRequest.newBuilder()
    .uri(URI.create("https://sandbox-api.biklo.com/v1/sandbox/messages"))
    .header("Authorization", "Bearer bk_test_YOUR_KEY")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString(
        "{ \"product_id\": 237233, \"body\": \"Is this still available?\" }"))
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());