Retrive instances

Get list of instances associated with the user

get
instance_whatsapp

https://api.mercury.chat/sdk/v1/whatsapp/instance_whatsapp?api_token=tokenAPI
Get list of instances associated with the user
Request
Response
Query Parameters
api_token
required
string
the api token (see the "Authentication" section)
200: OK
In "data" there is the list of instances.
{
"object": "list",
"data": [
{
"_id": "5ce28b7f9535f408c1650145",
"timestamp_finish": 1568524005,
"is_translated": true,
"translate_code": "en",
"timestamp_finish_translate": 1558437605,
"istance_number": "42496",
"status": "authenticated",
"timestamp_last_status": 1558689583202,
"timestamp_init_status": 1558625633134,
"chatId_owner": "441122334@c.us",
"isChecked": true
},
{
"_id": "5ce2b64ac40ce10b8bdfe5da",
"timestamp_finish": 1558539377,
"is_translated": true,
"translate_code": "en",
"timestamp_finish_translate": 1558452977,
"istance_number": "42101",
"status": "logout",
"timestamp_last_status": 1558368207988,
"timestamp_init_status": null,
"chatId_owner": "441122334@c.us",
"isChecked": false
}
],
"has_more": false,
"count_api": 1,
"reset_count_api": 61
}
404: Not Found
GENERIC ERROR

Example:

cURL
C#
Go
Java
NodeJs
Objective-C
PHP
Python
Ruby
Swift
curl -X GET \
'https://api.trackingram.chat/sdk/v1/whatsapp/instance_whatsapp?api_token=your_api_token'

var client = new RestClient("https://api.trackingram.chat/sdk/v1/whatsapp/instance_whatsapp?api_token=your_api_token");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);

package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.trackingram.chat/sdk/v1/whatsapp/instance_whatsapp?api_token=your_api_token"
req, _ := http.NewRequest("GET", url, nil)
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();
Request request = new Request.Builder()
.url("https://api.trackingram.chat/sdk/v1/whatsapp/instance_whatsapp?api_token=5ce28bde9535f408c1650146nIXqJj4Ln")
.get()
.build();
Response response = client.newCall(request).execute();

var request = require("request");
var options = { method: 'GET',
url: 'https://api.trackingram.chat/sdk/v1/whatsapp/instance_whatsapp',
qs: { api_token: '5ce28bde9535f408c1650146nIXqJj4Ln' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});

#import <Foundation/Foundation.h>
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.trackingram.chat/sdk/v1/whatsapp/instance_whatsapp?api_token=your_api_token"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];

<?php
$request = new HttpRequest();
$request->setUrl('https://api.trackingram.chat/sdk/v1/whatsapp/instance_whatsapp');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'api_token' => '5ce28bde9535f408c1650146nIXqJj4Ln'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}

import requests
url = "https://api.trackingram.chat/sdk/v1/whatsapp/instance_whatsapp"
querystring = {"api_token":"your_api_token"}
payload = ""
response = requests.request("GET", url, data=payload, params=querystring)
print(response.text)

require 'uri'
require 'net/http'
url = URI("https://api.trackingram.chat/sdk/v1/whatsapp/instance_whatsapp?api_token=5ce28bde9535f408c1650146nIXqJj4Ln")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body

import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "https://api.trackingram.chat/sdk/v1/whatsapp/instance_whatsapp?api_token=your_api_token")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()