Fetch Instances
curl --request GET \
--url https://api.l2msg.com/whatsapp/instance/fetchInstances \
--header 'apikey: <api-key>'import requests
url = "https://api.l2msg.com/whatsapp/instance/fetchInstances"
headers = {"apikey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<api-key>'}};
fetch('https://api.l2msg.com/whatsapp/instance/fetchInstances', 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.l2msg.com/whatsapp/instance/fetchInstances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <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"
"net/http"
"io"
)
func main() {
url := "https://api.l2msg.com/whatsapp/instance/fetchInstances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.l2msg.com/whatsapp/instance/fetchInstances")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.l2msg.com/whatsapp/instance/fetchInstances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"instance": {
"instanceName": "example-name",
"instanceId": "421a4121-a3d9-40cc-a8db-c3a1df353126",
"owner": "553198296801@s.whatsapp.net",
"profileName": "Guilherme Gomes",
"profilePictureUrl": null,
"profileStatus": "This is the profile status.",
"status": "open",
"serverUrl": "https://api.l2msg.com",
"apikey": "B3844804-481D-47A4-B69C-F14B4206EB56",
"integration": {
"integration": "WHATSAPP-BAILEYS",
"webhook_wa_business": "https://api.l2msg.com/webhook/whatsapp/db5e11d3-ded5-4d91-b3fb-48272688f206"
}
}
},
{
"instance": {
"instanceName": "teste-docs",
"instanceId": "af6c5b7c-ee27-4f94-9ea8-192393746ddd",
"status": "close",
"serverUrl": "https://api.l2msg.com",
"apikey": "123456",
"integration": {
"token": "123456",
"webhook_wa_business": "https://api.l2msg.com/webhook/whatsapp/teste-docs"
}
}
}
]Instances
Fetch Instances
Returns the instance with the name informed in the parameter, or all the instances if empty.
GET
/
instance
/
fetchInstances
Fetch Instances
curl --request GET \
--url https://api.l2msg.com/whatsapp/instance/fetchInstances \
--header 'apikey: <api-key>'import requests
url = "https://api.l2msg.com/whatsapp/instance/fetchInstances"
headers = {"apikey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<api-key>'}};
fetch('https://api.l2msg.com/whatsapp/instance/fetchInstances', 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.l2msg.com/whatsapp/instance/fetchInstances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <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"
"net/http"
"io"
)
func main() {
url := "https://api.l2msg.com/whatsapp/instance/fetchInstances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.l2msg.com/whatsapp/instance/fetchInstances")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.l2msg.com/whatsapp/instance/fetchInstances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"instance": {
"instanceName": "example-name",
"instanceId": "421a4121-a3d9-40cc-a8db-c3a1df353126",
"owner": "553198296801@s.whatsapp.net",
"profileName": "Guilherme Gomes",
"profilePictureUrl": null,
"profileStatus": "This is the profile status.",
"status": "open",
"serverUrl": "https://api.l2msg.com",
"apikey": "B3844804-481D-47A4-B69C-F14B4206EB56",
"integration": {
"integration": "WHATSAPP-BAILEYS",
"webhook_wa_business": "https://api.l2msg.com/webhook/whatsapp/db5e11d3-ded5-4d91-b3fb-48272688f206"
}
}
},
{
"instance": {
"instanceName": "teste-docs",
"instanceId": "af6c5b7c-ee27-4f94-9ea8-192393746ddd",
"status": "close",
"serverUrl": "https://api.l2msg.com",
"apikey": "123456",
"integration": {
"token": "123456",
"webhook_wa_business": "https://api.l2msg.com/webhook/whatsapp/teste-docs"
}
}
}
]Authorizations
Your authorization key header
Query Parameters
Name of the instance to be fetched
ID of the instance to be fetched
⌘I