Get product (ID)
curl --request GET \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/products/{productId} \
--header 'Client-Token: <api-key>'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/products/{productId}"
headers = {"Client-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Client-Token': '<api-key>'}};
fetch('https://api.z-api.io/instances/{instanceId}/token/{token}/products/{productId}', 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.z-api.io/instances/{instanceId}/token/{token}/products/{productId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Client-Token: <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.z-api.io/instances/{instanceId}/token/{token}/products/{productId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Client-Token", "<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.z-api.io/instances/{instanceId}/token/{token}/products/{productId}")
.header("Client-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/products/{productId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Client-Token"] = '<api-key>'
response = http.request(request)
puts response.read_bodyWhatsApp Business
Get product (ID)
Returns data for a specific product by ID
GET
/
instances
/
{instanceId}
/
token
/
{token}
/
products
/
{productId}
Get product (ID)
curl --request GET \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/products/{productId} \
--header 'Client-Token: <api-key>'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/products/{productId}"
headers = {"Client-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Client-Token': '<api-key>'}};
fetch('https://api.z-api.io/instances/{instanceId}/token/{token}/products/{productId}', 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.z-api.io/instances/{instanceId}/token/{token}/products/{productId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Client-Token: <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.z-api.io/instances/{instanceId}/token/{token}/products/{productId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Client-Token", "<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.z-api.io/instances/{instanceId}/token/{token}/products/{productId}")
.header("Client-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/products/{productId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Client-Token"] = '<api-key>'
response = http.request(request)
puts response.read_bodyOverview
With this method you can get data for a specific product by its ID from the WhatsApp Business catalog.Attributes
Header
string
required
Your instance ID. Available in the Z-API panel under Instances.
string
required
Your Z-API instance token.
Path
string
required
Product ID
Response
200
{
"cartEnabled": true,
"catalogId": "999999999999999",
"availability": "in stock",
"id": "999999999999999",
"retailerId": null,
"description": "Product description",
"price": "100000",
"salePrice": "90000",
"currency": "BRL",
"name": "Mouse",
"images": ["https://..."]
}
405
Make sure you are correctly sending the method specification, that is, verify that you sent POST or GET as specified at the beginning of this topic.415
If you receive a 415 error, make sure to add the “Content-Type” header to your request, which in most cases is “application/json”.⌘I