Skip to content

Private Chat ​

The /chat/private endpoint retrieves all messages sent during the last hour, belonging to a private chat.

Parameters ​

ParameterRequiredDescription
usernameYesThe username of the user who sends the message
tokenYesThe key used to connect to the desired private chat

Code Examples ​

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "username": "User3",
    "token": "41a43360-9874-4c7a-9ca8-eec29e765a0e"
  }' \
  "https://api.sylvain.sh/v6/chat/private"

Response Fields ​

FieldTypeDescription
usernamestringUsername of the message sender
messagestringContent of the message
timestampstringISO 8601 timestamp of the message

Try It ​

Error Handling ​

If parameters are missing or invalid, the API will return an error:

Error MessageDescription
Please provide a username (?username={username})The username parameter is missing
Please provide a valid token (&token={key}).The token parameter is missing or invalid
Invalid or expired tokenThe token is invalid or has expired
Rate limit exceededToo many requests in a short period