{"is_webhook_enable":true,"webhook_url":"https://webhook.site/20bf0fed-dc7a-4a39-b8bf-9b48cfbc819d"}
GENERIC ERROR
curl -X POST \'https://api.mercury.chat/sdk/v1/whatsapp/webhook?api_token=tokenAPI' \-H 'Content-Type: application/json' \-d '{"is_webhook_enable":true,"webhook_url":"https://webhook.site/0d45ed30-17f3-4768-8548-6c5493bd029e"}'
var client = new RestClient("https://api.mercury.chat/sdk/v1/whatsapp/webhook?api_token=tokenAPI");var request = new RestRequest(Method.POST);request.AddHeader("Content-Type", "application/json");request.AddParameter("undefined", "{\n\t\"is_webhook_enable\":true,\n\t\"webhook_url\":\"https://webhook.site/0d45ed30-17f3-4768-8548-6c5493bd029e\"\n}", ParameterType.RequestBody);IRestResponse response = client.Execute(request);
package main​import ("fmt""strings""net/http""io/ioutil")​func main() {​url := "https://api.mercury.chat/sdk/v1/whatsapp/webhook?api_token=tokenAPI"​payload := strings.NewReader("{\n\t\"is_webhook_enable\":true,\n\t\"webhook_url\":\"https://webhook.site/0d45ed30-17f3-4768-8548-6c5493bd029e\"\n}")​req, _ := http.NewRequest("POST", url, payload)​req.Header.Add("Content-Type", "application/json")​res, _ := http.DefaultClient.Do(req)​defer res.Body.Close()body, _ := ioutil.ReadAll(res.Body)​fmt.Println(res)fmt.Println(string(body))​}
OkHttpClient client = new OkHttpClient();​MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{\n\t\"is_webhook_enable\":true,\n\t\"webhook_url\":\"https://webhook.site/0d45ed30-17f3-4768-8548-6c5493bd029e\"\n}");Request request = new Request.Builder().url("https://api.mercury.chat/sdk/v1/whatsapp/webhook?api_token=tokenAPI").post(body).addHeader("Content-Type", "application/json").build();​Response response = client.newCall(request).execute();
var request = require("request");​var options = { method: 'POST',url: 'https://api.mercury.chat/sdk/v1/whatsapp/webhook',qs: { api_token: 'tokenAPI' },headers: { 'Content-Type': 'application/json' },body:{ is_webhook_enable: true,webhook_url: 'https://webhook.site/0d45ed30-17f3-4768-8548-6c5493bd029e' },json: true };​request(options, function (error, response, body) {if (error) throw new Error(error);​console.log(body);});
​
<?php​$request = new HttpRequest();$request->setUrl('https://api.mercury.chat/sdk/v1/whatsapp/webhook');$request->setMethod(HTTP_METH_POST);​$request->setQueryData(array('api_token' => 'tokenAPI'));​$request->setHeaders(array('Content-Type' => 'application/json'));​$request->setBody('{"is_webhook_enable":true,"webhook_url":"https://webhook.site/0d45ed30-17f3-4768-8548-6c5493bd029e"}');​try {$response = $request->send();​echo $response->getBody();} catch (HttpException $ex) {echo $ex;}
import requests​url = "https://api.mercury.chat/sdk/v1/whatsapp/webhook"​querystring = {"api_token":"tokenAPI"}​payload = "{\n\t\"is_webhook_enable\":true,\n\t\"webhook_url\":\"https://webhook.site/0d45ed30-17f3-4768-8548-6c5493bd029e\"\n}"headers = {'Content-Type': 'application/json'}​response = requests.request("POST", url, data=payload, headers=headers, params=querystring)​print(response.text)
require 'uri'require 'net/http'​url = URI("https://api.mercury.chat/sdk/v1/whatsapp/webhook?api_token=tokenAPI")​http = Net::HTTP.new(url.host, url.port)​request = Net::HTTP::Post.new(url)request["Content-Type"] = 'application/json'request.body = "{\n\t\"is_webhook_enable\":true,\n\t\"webhook_url\":\"https://webhook.site/0d45ed30-17f3-4768-8548-6c5493bd029e\"\n}"​response = http.request(request)puts response.read_body
​