Create or edit a template message
curl --request POST \
--url https://api.fanvue.com/v1/chats/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Fanvue-API-Version: <x-fanvue-api-version>' \
--data '
{
"folderUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.fanvue.com/v1/chats/templates"
payload = { "folderUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"X-Fanvue-API-Version": "<x-fanvue-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Fanvue-API-Version': '<x-fanvue-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({folderUuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.fanvue.com/v1/chats/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"uuid": "123e4567-e89b-12d3-a456-426614174003",
"name": "Welcome gift",
"text": "Welcome! Here's a little something to say thanks 💖",
"price": 500,
"folderUuid": "b0a1c2d3-e4f5-6789-abcd-ef0123456789",
"folderName": "Welcome Messages",
"mediaUuids": [
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
],
"mediaPreviewUuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}{
"uuid": "123e4567-e89b-12d3-a456-426614174003",
"name": "Welcome gift",
"text": "Welcome! Here's a little something to say thanks 💖",
"price": 500,
"folderUuid": "b0a1c2d3-e4f5-6789-abcd-ef0123456789",
"folderName": "Welcome Messages",
"mediaUuids": [
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
],
"mediaPreviewUuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"nextVersion": "<string>"
}{
"error": "Too many requests",
"rateLimit": {
"scope": "app",
"layer": "<string>",
"limit": 123,
"windowSeconds": 123,
"retryAfterSeconds": 123,
"docs": "<string>"
}
}Templates
Create or edit a template message
Creates a template message in one of the creator’s folders, or edits an existing one. Provide a folderUuid from GET /chats/templates/folders. Omit messageUuid to create the template (201); provide it to edit that template in place (200). A template must have text or at least one media attachment. An edit replaces the fields you send, so send the full template body rather than only the fields you are changing.
POST
/
v1
/
chats
/
templates
Create or edit a template message
curl --request POST \
--url https://api.fanvue.com/v1/chats/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Fanvue-API-Version: <x-fanvue-api-version>' \
--data '
{
"folderUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.fanvue.com/v1/chats/templates"
payload = { "folderUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"X-Fanvue-API-Version": "<x-fanvue-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Fanvue-API-Version': '<x-fanvue-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({folderUuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.fanvue.com/v1/chats/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"uuid": "123e4567-e89b-12d3-a456-426614174003",
"name": "Welcome gift",
"text": "Welcome! Here's a little something to say thanks 💖",
"price": 500,
"folderUuid": "b0a1c2d3-e4f5-6789-abcd-ef0123456789",
"folderName": "Welcome Messages",
"mediaUuids": [
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
],
"mediaPreviewUuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}{
"uuid": "123e4567-e89b-12d3-a456-426614174003",
"name": "Welcome gift",
"text": "Welcome! Here's a little something to say thanks 💖",
"price": 500,
"folderUuid": "b0a1c2d3-e4f5-6789-abcd-ef0123456789",
"folderName": "Welcome Messages",
"mediaUuids": [
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
],
"mediaPreviewUuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"nextVersion": "<string>"
}{
"error": "Too many requests",
"rateLimit": {
"scope": "app",
"layer": "<string>",
"limit": 123,
"windowSeconds": 123,
"retryAfterSeconds": 123,
"docs": "<string>"
}
}Required scope
write:chat— Create new chats and send messages. This scope is required for any chat-related actions that modify data.
Authorizations
Scopes
Headers
Body
application/json
Message text content. At most 5000 characters.
Maximum string length:
5000Response
Template message updated
Was this page helpful?