Message without parameter Estimated reading: 2 minutes 108 views Description:Send a basic template message without any parameters.Endpoint:http://{{your_domain}}/api/v1.0/{{phone_number_id}}/{{key}}/messagesReplace the placeholders:{{your_domain}}: Your API domain. {{phone_number_id}}: The ID linked to your WhatsApp Business API number. {{key}}: Your API key for authentication.How to create keyMethod:POSTHeaders:Content-Type: application/json Authorization: Bearer <your_access_token>Example : { "messaging_product": "whatsapp", "recipient_type": "individual", "to": "91xxxxxxxxxx", "type": "template", "template": { "name": "utility_templates", "language": { "code": "en" }, "components": [ ] } }Field Descriptions:messaging_product: Always "whatsapp" for WhatsApp messaging. recipient_type: "individual" for single-user messages. to: Recipient’s phone number in E.164 format (e.g., 91xxxxxxxxxx for an Indian number). type: "template" for template messages. template: Contains details about the template:name: Name of the pre-approved template (utility_templates in this case). language: Specifies the language code.code: Language code for the template (e.g., en for English). components: An array for dynamic content or interactive elements (leave empty for simple messages).Example ResponseWhen the API processes the request successfully, it returns a response similar to this: CURL PHP Java Ruby Python C# Node JS curl –location ‘https://example.com/api/v1.0/phone_number_id/key/messages’ \ –header ‘Content-Type: application/json’ \ –header ‘Authorization: Bearer xxxxxx…….’ \ –data ‘{ “messaging_product”: “whatsapp”, “to”: “919946371505”, “type”: “template”, “template”: { “name”: “utility_a”, “language”: { “code”: “en_us” }, “components”: [ ] } }’ ‘<'+'?'+'php'+ ` $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => ‘https://${domain}/api/v1.0/phone_number_id/key/messages’, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => ”, CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => ‘POST’, CURLOPT_POSTFIELDS => ‘{ “messaging_product”: “whatsapp”, “recipient_type”: “individual”, “to”: “whatsapp:+${toNumber}”, “type”: “template”, “template”: { “name”: “${selectedTemplateName}”, “language”: { “code”: “en” }, “components”: [ { “type”: “body”, “parameters”: ${JSON.stringify(parameters)} } ] } }’, CURLOPT_HTTPHEADER => array( ‘authToken: ${userToken}’, ‘Content-Type: application/json’ ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ?>;`; OkHttpClient client = new OkHttpClient().newBuilder() .build(); MediaType mediaType = MediaType.parse(“application/json”); RequestBody body = RequestBody.create(mediaType, “{\n \”messaging_product\”: \”whatsapp\”,\n \”to\”: \”919946371505\”,\n \”type\”: \”template\”,\n \”template\”: {\n \”name\”: \”utility_a\”,\n \”language\”: {\n \”code\”: \”en_us\”\n },\n \”components\”: [\n ]\n }\n}”); Request request = new Request.Builder() .url(“https://app.pingtochat.com/api/v1.0/phone_number_id/key/messages”) .method(“POST”, body) .addHeader(“Content-Type”, “application/json”) .addHeader(“Authorization”, “Bearer eyJpdiI6IndwTkFXZUdiY3BNdWUwMnhDem04eGc9PSIsInZhbHVlIjoiQ3c2aDYxYWxBQmtRSkVGNllRRGpOUT09IiwibWFjIjoiMzk4ODRlMmY4ZDEzODAyODFjNThlYmQwMzEyMzYyYjUwNjk0NzE3YWU5NzRkOGE4ODE5NWZmYTg3ZDBmNjk0MCIsInRhZyI6IiJ9”) .build(); Response response = client.newCall(request).execute(); require “uri” require “json” require “net/http” url = URI(“https://app.pingtochat.com/api/v1.0/phone_number_id/key/messages”) https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request[“Content-Type”] = “application/json” request[“Authorization”] = “Bearer eyJpdiI6IndwTkFXZUdiY3BNdWUwMnhDem04eGc9PSIsInZhbHVlIjoiQ3c2aDYxYWxBQmtRSkVGNllRRGpOUT09IiwibWFjIjoiMzk4ODRlMmY4ZDEzODAyODFjNThlYmQwMzEyMzYyYjUwNjk0NzE3YWU5NzRkOGE4ODE5NWZmYTg3ZDBmNjk0MCIsInRhZyI6IiJ9” request.body = JSON.dump({ “messaging_product”: “whatsapp”, “to”: “919946371505”, “type”: “template”, “template”: { “name”: “utility_a”, “language”: { “code”: “en_us” }, “components”: [] } }) response = https.request(request) puts response.read_body import http.client import json conn = http.client.HTTPSConnection(“app.pingtochat.com”) payload = json.dumps({ “messaging_product”: “whatsapp”, “to”: “919946371505”, “type”: “template”, “template”: { “name”: “utility_a”, “language”: { “code”: “en_us” }, “components”: [] } }) headers = { ‘Content-Type’: ‘application/json’, ‘Authorization’: ‘Bearer eyJpdiI6IndwTkFXZUdiY3BNdWUwMnhDem04eGc9PSIsInZhbHVlIjoiQ3c2aDYxYWxBQmtRSkVGNllRRGpOUT09IiwibWFjIjoiMzk4ODRlMmY4ZDEzODAyODFjNThlYmQwMzEyMzYyYjUwNjk0NzE3YWU5NzRkOGE4ODE5NWZmYTg3ZDBmNjk0MCIsInRhZyI6IiJ9’ } conn.request(“POST”, “/api/v1.0/phone_number_id/key/messages”, payload, headers) res = conn.getresponse() data = res.read() print(data.decode(“utf-8”)) var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, “https://app.pingtochat.com/api/v1.0/phone_number_id/key/messages”); request.Headers.Add(“Authorization”, “Bearer eyJpdiI6IndwTkFXZUdiY3BNdWUwMnhDem04eGc9PSIsInZhbHVlIjoiQ3c2aDYxYWxBQmtRSkVGNllRRGpOUT09IiwibWFjIjoiMzk4ODRlMmY4ZDEzODAyODFjNThlYmQwMzEyMzYyYjUwNjk0NzE3YWU5NzRkOGE4ODE5NWZmYTg3ZDBmNjk0MCIsInRhZyI6IiJ9”); var content = new StringContent(“{\n \”messaging_product\”: \”whatsapp\”,\n \”to\”: \”919946371505\”,\n \”type\”: \”template\”,\n \”template\”: {\n \”name\”: \”utility_a\”,\n \”language\”: {\n \”code\”: \”en_us\”\n },\n \”components\”: [\n ]\n }\n}”, null, “application/json”); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); var request = require(‘request’); var options = { ‘method’: ‘POST’, ‘url’: ‘https://app.pingtochat.com/api/v1.0/phone_number_id/key/messages’, ‘headers’: { ‘Content-Type’: ‘application/json’, ‘Authorization’: ‘Bearer eyJpdiI6IndwTkFXZUdiY3BNdWUwMnhDem04eGc9PSIsInZhbHVlIjoiQ3c2aDYxYWxBQmtRSkVGNllRRGpOUT09IiwibWFjIjoiMzk4ODRlMmY4ZDEzODAyODFjNThlYmQwMzEyMzYyYjUwNjk0NzE3YWU5NzRkOGE4ODE5NWZmYTg3ZDBmNjk0MCIsInRhZyI6IiJ9’ }, body: JSON.stringify({ “messaging_product”: “whatsapp”, “to”: “919946371505”, “type”: “template”, “template”: { “name”: “utility_a”, “language”: { “code”: “en_us” }, “components”: [] } }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); { "messaging_product": "whatsapp", "contacts": [ { "input": "91xxxxxxxxxx", "wa_id": "91xxxxxxxxxx", "status_id": "ODIxMTg=" } ], "messages": [ { "id": "4gmNEgkX7r", "message_status": "accepted" } ] }Response Details:contacts:input: The phone number you provided in the to field. wa_id: WhatsApp ID of the recipient. status_id: A unique identifier for the status of this contact. messages:id: A unique ID for the message. message_status: Status of the message (e.g., "accepted").