API Reference
Set reservation message sender
Requires reservations:messaging:write. Select an available WhatsApp sender in this business for one Cloudbeds integration. Does not send a message immediately.
PUT
/
reservations
/
lifecycle
/
integrations
/
{integrationId}
/
sender
Set reservation message sender
curl --request PUT \
--url https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channelId": "<string>"
}
'import requests
url = "https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender"
payload = { "channelId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({channelId: '<string>'})
};
fetch('https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender', 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://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'channelId' => '<string>'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender"
payload := strings.NewReader("{\n \"channelId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channelId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channelId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"masterEnabled": true,
"events": [
{
"eventType": "booking_confirmed",
"label": "<string>",
"attachedIntegrationCount": 123,
"enabledIntegrationCount": 123,
"disabledIntegrationCount": 123,
"allEnabled": true,
"someEnabled": true,
"health": "healthy",
"metrics7d": {
"sent": 123,
"failed": 123,
"notSent": 123
},
"senders": [
{
"channelId": "<string>",
"active": true,
"respondEnabled": true,
"integrationIds": [
"<string>"
],
"phoneNumber": "<string>",
"name": "<string>"
}
],
"integrations": [
{
"provider": "cloudbeds",
"integrationId": "<string>",
"eligible": true,
"integrationActive": true,
"integrationEligible": true,
"eventEnabled": true,
"senderStatus": "selected",
"senderCandidates": [
{
"channelId": "<string>",
"active": true,
"respondEnabled": true,
"integrationIds": [
"<string>"
],
"phoneNumber": "<string>",
"name": "<string>"
}
],
"senders": [
{
"channelId": "<string>",
"active": true,
"respondEnabled": true,
"integrationIds": [
"<string>"
],
"phoneNumber": "<string>",
"name": "<string>"
}
],
"name": "<string>",
"propertyId": "<string>",
"propertyName": "<string>",
"selectedSender": {
"channelId": "<string>",
"active": true,
"respondEnabled": true,
"integrationIds": [
"<string>"
],
"phoneNumber": "<string>",
"name": "<string>"
}
}
],
"templatePreview": {
"locales": [
{
"locale": "en_US",
"body": "<string>",
"buttons": [
"<string>"
]
}
]
},
"metaTemplates": {
"total": 123,
"approved": 123,
"pending": 123,
"rejected": 123,
"paused": 123,
"rows": [
{
"channelId": "<string>",
"locale": "en_US",
"templateName": "<string>",
"status": "pending",
"version": 123,
"phoneNumber": "<string>",
"templateId": "<string>",
"lastFetchedAt": "<string>",
"lastCreatedAt": "<string>",
"lastProviderErrorCode": "<string>",
"rejectedReason": "<string>"
}
]
}
}
]
}{
"error": {
"code": "M2M_AUTH_INSUFFICIENT_SCOPE",
"message": "M2M credential does not have required scope.",
"details": {
"requiredScopes": [
"conversations:write"
],
"missingScopes": [
"conversations:write"
]
}
}
}Authorizations
Server-side tenant-scoped credential created from Build > API Keys.
Path Parameters
Required string length:
1 - 200Body
application/json
Required string length:
1 - 120⌘I
Set reservation message sender
curl --request PUT \
--url https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channelId": "<string>"
}
'import requests
url = "https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender"
payload = { "channelId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({channelId: '<string>'})
};
fetch('https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender', 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://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'channelId' => '<string>'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender"
payload := strings.NewReader("{\n \"channelId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channelId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.visitoai.com/m2m/v1/reservations/lifecycle/integrations/{integrationId}/sender")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channelId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"masterEnabled": true,
"events": [
{
"eventType": "booking_confirmed",
"label": "<string>",
"attachedIntegrationCount": 123,
"enabledIntegrationCount": 123,
"disabledIntegrationCount": 123,
"allEnabled": true,
"someEnabled": true,
"health": "healthy",
"metrics7d": {
"sent": 123,
"failed": 123,
"notSent": 123
},
"senders": [
{
"channelId": "<string>",
"active": true,
"respondEnabled": true,
"integrationIds": [
"<string>"
],
"phoneNumber": "<string>",
"name": "<string>"
}
],
"integrations": [
{
"provider": "cloudbeds",
"integrationId": "<string>",
"eligible": true,
"integrationActive": true,
"integrationEligible": true,
"eventEnabled": true,
"senderStatus": "selected",
"senderCandidates": [
{
"channelId": "<string>",
"active": true,
"respondEnabled": true,
"integrationIds": [
"<string>"
],
"phoneNumber": "<string>",
"name": "<string>"
}
],
"senders": [
{
"channelId": "<string>",
"active": true,
"respondEnabled": true,
"integrationIds": [
"<string>"
],
"phoneNumber": "<string>",
"name": "<string>"
}
],
"name": "<string>",
"propertyId": "<string>",
"propertyName": "<string>",
"selectedSender": {
"channelId": "<string>",
"active": true,
"respondEnabled": true,
"integrationIds": [
"<string>"
],
"phoneNumber": "<string>",
"name": "<string>"
}
}
],
"templatePreview": {
"locales": [
{
"locale": "en_US",
"body": "<string>",
"buttons": [
"<string>"
]
}
]
},
"metaTemplates": {
"total": 123,
"approved": 123,
"pending": 123,
"rejected": 123,
"paused": 123,
"rows": [
{
"channelId": "<string>",
"locale": "en_US",
"templateName": "<string>",
"status": "pending",
"version": 123,
"phoneNumber": "<string>",
"templateId": "<string>",
"lastFetchedAt": "<string>",
"lastCreatedAt": "<string>",
"lastProviderErrorCode": "<string>",
"rejectedReason": "<string>"
}
]
}
}
]
}{
"error": {
"code": "M2M_AUTH_INSUFFICIENT_SCOPE",
"message": "M2M credential does not have required scope.",
"details": {
"requiredScopes": [
"conversations:write"
],
"missingScopes": [
"conversations:write"
]
}
}
}