Create a new group
curl --request POST \
--url https://api.interacto.io/group \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'Instance-Id: <instance-id>' \
--data '
{
"name": "My Cool Group",
"participants": [
"551199999999",
"551188888888"
]
}
'import requests
url = "https://api.interacto.io/group"
payload = {
"name": "My Cool Group",
"participants": ["551199999999", "551188888888"]
}
headers = {
"Instance-Id": "<instance-id>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Instance-Id': '<instance-id>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'My Cool Group', participants: ['551199999999', '551188888888']})
};
fetch('https://api.interacto.io/group', 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.interacto.io/group",
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([
'name' => 'My Cool Group',
'participants' => [
'551199999999',
'551188888888'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"Instance-Id: <instance-id>"
],
]);
$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.interacto.io/group"
payload := strings.NewReader("{\n \"name\": \"My Cool Group\",\n \"participants\": [\n \"551199999999\",\n \"551188888888\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Instance-Id", "<instance-id>")
req.Header.Add("Authorization", "<api-key>")
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.interacto.io/group")
.header("Instance-Id", "<instance-id>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Cool Group\",\n \"participants\": [\n \"551199999999\",\n \"551188888888\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.interacto.io/group")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Instance-Id"] = '<instance-id>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My Cool Group\",\n \"participants\": [\n \"551199999999\",\n \"551188888888\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "66c266130c991c46299dedf8",
"wpId": "120363321438738644@g.us",
"instanceId": "66a09db606fd14660c8fc1d0",
"name": "My Cool Group",
"image": "",
"participants": [
"551199999999",
"551188888888"
],
"admins": []
}{
"error": 123,
"message": "<string>"
}Endpoints
Criar grupo
O endpoint /group permite a criação de um novo grupo na plataforma Interacto. Este endpoint requer a especificação dos participantes do grupo e o nome do grupo que está sendo criado.
POST
/
group
Create a new group
curl --request POST \
--url https://api.interacto.io/group \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'Instance-Id: <instance-id>' \
--data '
{
"name": "My Cool Group",
"participants": [
"551199999999",
"551188888888"
]
}
'import requests
url = "https://api.interacto.io/group"
payload = {
"name": "My Cool Group",
"participants": ["551199999999", "551188888888"]
}
headers = {
"Instance-Id": "<instance-id>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Instance-Id': '<instance-id>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'My Cool Group', participants: ['551199999999', '551188888888']})
};
fetch('https://api.interacto.io/group', 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.interacto.io/group",
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([
'name' => 'My Cool Group',
'participants' => [
'551199999999',
'551188888888'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"Instance-Id: <instance-id>"
],
]);
$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.interacto.io/group"
payload := strings.NewReader("{\n \"name\": \"My Cool Group\",\n \"participants\": [\n \"551199999999\",\n \"551188888888\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Instance-Id", "<instance-id>")
req.Header.Add("Authorization", "<api-key>")
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.interacto.io/group")
.header("Instance-Id", "<instance-id>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Cool Group\",\n \"participants\": [\n \"551199999999\",\n \"551188888888\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.interacto.io/group")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Instance-Id"] = '<instance-id>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My Cool Group\",\n \"participants\": [\n \"551199999999\",\n \"551188888888\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "66c266130c991c46299dedf8",
"wpId": "120363321438738644@g.us",
"instanceId": "66a09db606fd14660c8fc1d0",
"name": "My Cool Group",
"image": "",
"participants": [
"551199999999",
"551188888888"
],
"admins": []
}{
"error": 123,
"message": "<string>"
}Authorizations
API Key needed to access the endpoints
Headers
Unique identifier for the instance
Body
application/json
Response
Group created successfully
Unique identifier for the created group
Example:
"66c266130c991c46299dedf8"
Id do seu grupo no Whatsapp
Example:
"120363321438738644@g.us"
Id da instancia onde o seu grupo foi criado
Example:
"66a09db606fd14660c8fc1d0"
Nome que voce deu ao seu grupo
Example:
"My Cool Group"
Url da imagem do seu grupo
Example:
""
Participantes que estao no seu grupo
Example:
["551199999999", "551188888888"]
Admistradores que voce delegou
Example:
[]
⌘I