cURL
curl --request POST \
--url 'https://api.iomnihub.ai/stable/open/customers/send-attachment-message?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "1022",
"attachment_type": "image",
"attachment_url": "https://iomnihub.com/logo.png"
}
'import requests
url = "https://api.iomnihub.ai/stable/open/customers/send-attachment-message?api_key="
payload = {
"customer_id": "1022",
"attachment_type": "image",
"attachment_url": "https://iomnihub.com/logo.png"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '1022',
attachment_type: 'image',
attachment_url: 'https://iomnihub.com/logo.png'
})
};
fetch('https://api.iomnihub.ai/stable/open/customers/send-attachment-message?api_key=', 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.iomnihub.ai/stable/open/customers/send-attachment-message?api_key=",
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([
'customer_id' => '1022',
'attachment_type' => 'image',
'attachment_url' => 'https://iomnihub.com/logo.png'
]),
CURLOPT_HTTPHEADER => [
"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://api.iomnihub.ai/stable/open/customers/send-attachment-message?api_key="
payload := strings.NewReader("{\n \"customer_id\": \"1022\",\n \"attachment_type\": \"image\",\n \"attachment_url\": \"https://iomnihub.com/logo.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.iomnihub.ai/stable/open/customers/send-attachment-message?api_key=")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"1022\",\n \"attachment_type\": \"image\",\n \"attachment_url\": \"https://iomnihub.com/logo.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iomnihub.ai/stable/open/customers/send-attachment-message?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"1022\",\n \"attachment_type\": \"image\",\n \"attachment_url\": \"https://iomnihub.com/logo.png\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"project_id": 123,
"timestamp": "<string>",
"function_name": "<string>",
"message": "<string>",
"status": "<string>",
"extra": {
"timestamp": "<string>",
"project_id": 123,
"platform_id": 123,
"customer_id": 123,
"customer_phone": "<string>",
"template_id": "<string>",
"template_name": "<string>",
"source": "<string>",
"success": true,
"report": {
"messaging_product": "<string>",
"contacts": [
{
"input": "<string>",
"wa_id": "<string>"
}
],
"messages": [
{
"id": "<string>",
"message_status": "<string>"
}
]
}
}
}{
"error": "<string>",
"code": "<string>",
"success": true
}{
"detail": "Invalid api key provided."
}Message
Send Attachment
Sends an attachment to a iOmniHub customer in any platform
POST
/
stable
/
open
/
customers
/
send-attachment-message
cURL
curl --request POST \
--url 'https://api.iomnihub.ai/stable/open/customers/send-attachment-message?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "1022",
"attachment_type": "image",
"attachment_url": "https://iomnihub.com/logo.png"
}
'import requests
url = "https://api.iomnihub.ai/stable/open/customers/send-attachment-message?api_key="
payload = {
"customer_id": "1022",
"attachment_type": "image",
"attachment_url": "https://iomnihub.com/logo.png"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '1022',
attachment_type: 'image',
attachment_url: 'https://iomnihub.com/logo.png'
})
};
fetch('https://api.iomnihub.ai/stable/open/customers/send-attachment-message?api_key=', 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.iomnihub.ai/stable/open/customers/send-attachment-message?api_key=",
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([
'customer_id' => '1022',
'attachment_type' => 'image',
'attachment_url' => 'https://iomnihub.com/logo.png'
]),
CURLOPT_HTTPHEADER => [
"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://api.iomnihub.ai/stable/open/customers/send-attachment-message?api_key="
payload := strings.NewReader("{\n \"customer_id\": \"1022\",\n \"attachment_type\": \"image\",\n \"attachment_url\": \"https://iomnihub.com/logo.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.iomnihub.ai/stable/open/customers/send-attachment-message?api_key=")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"1022\",\n \"attachment_type\": \"image\",\n \"attachment_url\": \"https://iomnihub.com/logo.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iomnihub.ai/stable/open/customers/send-attachment-message?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"1022\",\n \"attachment_type\": \"image\",\n \"attachment_url\": \"https://iomnihub.com/logo.png\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"project_id": 123,
"timestamp": "<string>",
"function_name": "<string>",
"message": "<string>",
"status": "<string>",
"extra": {
"timestamp": "<string>",
"project_id": 123,
"platform_id": 123,
"customer_id": 123,
"customer_phone": "<string>",
"template_id": "<string>",
"template_name": "<string>",
"source": "<string>",
"success": true,
"report": {
"messaging_product": "<string>",
"contacts": [
{
"input": "<string>",
"wa_id": "<string>"
}
],
"messages": [
{
"id": "<string>",
"message_status": "<string>"
}
]
}
}
}{
"error": "<string>",
"code": "<string>",
"success": true
}{
"detail": "Invalid api key provided."
}Authorizations
Body
application/json
Attachment to send
The Id of the customer in iOmniHub, can be found in iOmniHub Dashboard or API/Webhook call
Example:
"1022"
Type of the attachment
Available options:
image, video, document Example:
"image"
Publicly accessible URL of the attachment
Example:
"https://iomnihub.com/logo.png"
⌘I