Chat thread send message
curl --request POST \
--url https://api.ofauth.com/v3/access/chats/:userId/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-linked-account-id: <api-key>' \
--data '
{
"isForwardedMessage": false,
"text": "",
"replyToMessageId": "<string>",
"mediaItems": [],
"isLockedText": false,
"price": 0,
"previewMediaCount": 0,
"releaseForms": {
"users": [],
"partners": [],
"guests": []
},
"userTags": [],
"isMarkdown": true
}
'import requests
url = "https://api.ofauth.com/v3/access/chats/:userId/messages"
payload = {
"isForwardedMessage": False,
"text": "",
"replyToMessageId": "<string>",
"mediaItems": [],
"isLockedText": False,
"price": 0,
"previewMediaCount": 0,
"releaseForms": {
"users": [],
"partners": [],
"guests": []
},
"userTags": [],
"isMarkdown": True
}
headers = {
"x-linked-account-id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-linked-account-id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
isForwardedMessage: false,
text: '',
replyToMessageId: '<string>',
mediaItems: [],
isLockedText: false,
price: 0,
previewMediaCount: 0,
releaseForms: {users: [], partners: [], guests: []},
userTags: [],
isMarkdown: true
})
};
fetch('https://api.ofauth.com/v3/access/chats/:userId/messages', 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.ofauth.com/v3/access/chats/:userId/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([
'isForwardedMessage' => false,
'text' => '',
'replyToMessageId' => '<string>',
'mediaItems' => [
],
'isLockedText' => false,
'price' => 0,
'previewMediaCount' => 0,
'releaseForms' => [
'users' => [
],
'partners' => [
],
'guests' => [
]
],
'userTags' => [
],
'isMarkdown' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-linked-account-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ofauth.com/v3/access/chats/:userId/messages"
payload := strings.NewReader("{\n \"isForwardedMessage\": false,\n \"text\": \"\",\n \"replyToMessageId\": \"<string>\",\n \"mediaItems\": [],\n \"isLockedText\": false,\n \"price\": 0,\n \"previewMediaCount\": 0,\n \"releaseForms\": {\n \"users\": [],\n \"partners\": [],\n \"guests\": []\n },\n \"userTags\": [],\n \"isMarkdown\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-linked-account-id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ofauth.com/v3/access/chats/:userId/messages")
.header("x-linked-account-id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isForwardedMessage\": false,\n \"text\": \"\",\n \"replyToMessageId\": \"<string>\",\n \"mediaItems\": [],\n \"isLockedText\": false,\n \"price\": 0,\n \"previewMediaCount\": 0,\n \"releaseForms\": {\n \"users\": [],\n \"partners\": [],\n \"guests\": []\n },\n \"userTags\": [],\n \"isMarkdown\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ofauth.com/v3/access/chats/:userId/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-linked-account-id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isForwardedMessage\": false,\n \"text\": \"\",\n \"replyToMessageId\": \"<string>\",\n \"mediaItems\": [],\n \"isLockedText\": false,\n \"price\": 0,\n \"previewMediaCount\": 0,\n \"releaseForms\": {\n \"users\": [],\n \"partners\": [],\n \"guests\": []\n },\n \"userTags\": [],\n \"isMarkdown\": true\n}"
response = http.request(request)
puts response.read_body{
"canBePinned": true,
"cancelSeconds": 123,
"canPurchase": true,
"canPurchaseReason": "<string>",
"canReport": true,
"changedAt": "<string>",
"createdAt": "<string>",
"fromUser": {
"id": 123
},
"giphyId": null,
"id": 123,
"isCouplePeopleMedia": true,
"isFree": true,
"isFromQueue": true,
"isLiked": true,
"isMarkdownDisabled": true,
"isMediaReady": true,
"isNew": true,
"isOpened": true,
"isPinned": true,
"isReportedByMe": true,
"isTip": true,
"lockedText": true,
"media": [
{
"canView": true,
"convertedToVideo": true,
"createdAt": "<string>",
"duration": 123,
"files": {
"full": {
"height": 123,
"size": 123,
"sources": [
"<unknown>"
],
"url": "<string>",
"width": 123
},
"preview": {
"height": 123,
"size": 123,
"url": "<string>",
"width": 123
},
"squarePreview": {
"height": 123,
"size": 123,
"url": "<string>",
"width": 123
},
"thumb": {
"height": 123,
"size": 123,
"url": "<string>",
"width": 123
}
},
"hasCustomPreview": true,
"hasError": true,
"id": 123,
"isReady": true,
"type": "<string>",
"videoSources": {
"240": null,
"720": null
}
}
],
"mediaCount": 123,
"previews": [
"<unknown>"
],
"price": 123,
"queueId": 123,
"releaseForms": [
"<unknown>"
],
"responseType": "<string>",
"story": {
"id": 123,
"media": [
{
"canView": true,
"convertedToVideo": true,
"createdAt": null,
"duration": 123,
"files": {
"full": {
"height": 123,
"size": 123,
"sources": [
"<unknown>"
],
"url": "<string>",
"width": 123
},
"preview": {
"height": 123,
"size": 123,
"sources": {
"w150": "<string>"
},
"url": "<string>",
"width": 123
},
"squarePreview": {
"height": 123,
"size": 123,
"sources": {
"w150": "<string>",
"w480": "<string>"
},
"url": "<string>",
"width": 123
},
"thumb": {
"height": 123,
"size": 123,
"url": "<string>",
"width": 123
}
},
"hasCustomPreview": true,
"hasError": true,
"id": 123,
"isReady": true,
"type": "<string>",
"videoSources": {
"240": null,
"720": null
}
}
],
"question": null,
"userId": 123
},
"text": "<string>"
}Messages
Chat thread send message
Send a direct message to a chat user. Supports text, pricing options, and uploaded media references.
Required scope: messages:write
POST
/
v3
/
access
/
chats
/
:userId
/
messages
Chat thread send message
curl --request POST \
--url https://api.ofauth.com/v3/access/chats/:userId/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-linked-account-id: <api-key>' \
--data '
{
"isForwardedMessage": false,
"text": "",
"replyToMessageId": "<string>",
"mediaItems": [],
"isLockedText": false,
"price": 0,
"previewMediaCount": 0,
"releaseForms": {
"users": [],
"partners": [],
"guests": []
},
"userTags": [],
"isMarkdown": true
}
'import requests
url = "https://api.ofauth.com/v3/access/chats/:userId/messages"
payload = {
"isForwardedMessage": False,
"text": "",
"replyToMessageId": "<string>",
"mediaItems": [],
"isLockedText": False,
"price": 0,
"previewMediaCount": 0,
"releaseForms": {
"users": [],
"partners": [],
"guests": []
},
"userTags": [],
"isMarkdown": True
}
headers = {
"x-linked-account-id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-linked-account-id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
isForwardedMessage: false,
text: '',
replyToMessageId: '<string>',
mediaItems: [],
isLockedText: false,
price: 0,
previewMediaCount: 0,
releaseForms: {users: [], partners: [], guests: []},
userTags: [],
isMarkdown: true
})
};
fetch('https://api.ofauth.com/v3/access/chats/:userId/messages', 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.ofauth.com/v3/access/chats/:userId/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([
'isForwardedMessage' => false,
'text' => '',
'replyToMessageId' => '<string>',
'mediaItems' => [
],
'isLockedText' => false,
'price' => 0,
'previewMediaCount' => 0,
'releaseForms' => [
'users' => [
],
'partners' => [
],
'guests' => [
]
],
'userTags' => [
],
'isMarkdown' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-linked-account-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ofauth.com/v3/access/chats/:userId/messages"
payload := strings.NewReader("{\n \"isForwardedMessage\": false,\n \"text\": \"\",\n \"replyToMessageId\": \"<string>\",\n \"mediaItems\": [],\n \"isLockedText\": false,\n \"price\": 0,\n \"previewMediaCount\": 0,\n \"releaseForms\": {\n \"users\": [],\n \"partners\": [],\n \"guests\": []\n },\n \"userTags\": [],\n \"isMarkdown\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-linked-account-id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ofauth.com/v3/access/chats/:userId/messages")
.header("x-linked-account-id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isForwardedMessage\": false,\n \"text\": \"\",\n \"replyToMessageId\": \"<string>\",\n \"mediaItems\": [],\n \"isLockedText\": false,\n \"price\": 0,\n \"previewMediaCount\": 0,\n \"releaseForms\": {\n \"users\": [],\n \"partners\": [],\n \"guests\": []\n },\n \"userTags\": [],\n \"isMarkdown\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ofauth.com/v3/access/chats/:userId/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-linked-account-id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isForwardedMessage\": false,\n \"text\": \"\",\n \"replyToMessageId\": \"<string>\",\n \"mediaItems\": [],\n \"isLockedText\": false,\n \"price\": 0,\n \"previewMediaCount\": 0,\n \"releaseForms\": {\n \"users\": [],\n \"partners\": [],\n \"guests\": []\n },\n \"userTags\": [],\n \"isMarkdown\": true\n}"
response = http.request(request)
puts response.read_body{
"canBePinned": true,
"cancelSeconds": 123,
"canPurchase": true,
"canPurchaseReason": "<string>",
"canReport": true,
"changedAt": "<string>",
"createdAt": "<string>",
"fromUser": {
"id": 123
},
"giphyId": null,
"id": 123,
"isCouplePeopleMedia": true,
"isFree": true,
"isFromQueue": true,
"isLiked": true,
"isMarkdownDisabled": true,
"isMediaReady": true,
"isNew": true,
"isOpened": true,
"isPinned": true,
"isReportedByMe": true,
"isTip": true,
"lockedText": true,
"media": [
{
"canView": true,
"convertedToVideo": true,
"createdAt": "<string>",
"duration": 123,
"files": {
"full": {
"height": 123,
"size": 123,
"sources": [
"<unknown>"
],
"url": "<string>",
"width": 123
},
"preview": {
"height": 123,
"size": 123,
"url": "<string>",
"width": 123
},
"squarePreview": {
"height": 123,
"size": 123,
"url": "<string>",
"width": 123
},
"thumb": {
"height": 123,
"size": 123,
"url": "<string>",
"width": 123
}
},
"hasCustomPreview": true,
"hasError": true,
"id": 123,
"isReady": true,
"type": "<string>",
"videoSources": {
"240": null,
"720": null
}
}
],
"mediaCount": 123,
"previews": [
"<unknown>"
],
"price": 123,
"queueId": 123,
"releaseForms": [
"<unknown>"
],
"responseType": "<string>",
"story": {
"id": 123,
"media": [
{
"canView": true,
"convertedToVideo": true,
"createdAt": null,
"duration": 123,
"files": {
"full": {
"height": 123,
"size": 123,
"sources": [
"<unknown>"
],
"url": "<string>",
"width": 123
},
"preview": {
"height": 123,
"size": 123,
"sources": {
"w150": "<string>"
},
"url": "<string>",
"width": 123
},
"squarePreview": {
"height": 123,
"size": 123,
"sources": {
"w150": "<string>",
"w480": "<string>"
},
"url": "<string>",
"width": 123
},
"thumb": {
"height": 123,
"size": 123,
"url": "<string>",
"width": 123
}
},
"hasCustomPreview": true,
"hasError": true,
"id": 123,
"isReady": true,
"type": "<string>",
"videoSources": {
"240": null,
"720": null
}
}
],
"question": null,
"userId": 123
},
"text": "<string>"
}Authorizations
Headers
Body
application/json
Plain text with optional formatting marks. HTML is displayed as text. See Text formatting.
Maximum string length:
10000Media references to attach. Accepts vault media IDs, upload references (mediaUploadId), or http(s) URLs. See mediaItems reference.
OnlyFans media ID
Required range:
x > 0Apply formatting marks (default: true). Set false to keep marks as literal text. HTML is displayed as text in both modes. See Text formatting.
Response
Successful response
Was this page helpful?