curl --request POST \
  --url https://api.ambiverse.com/v2/entitylinking/analyze \
  --header 'accept: application/json' \
  --header 'authorization: Bearer: YOUR_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"coherentDocument": "true", "confidenceThreshold": "0", "docId": "doc1", "text": "When Who played Tommy in Columbus, Pete was at his best.", "language": "en",  "annotatedMentions" : [ { "charLength":3, "charOffset":5 } ] }'
var unirest = require("unirest");

var req = unirest("POST", "https://api.ambiverse.com/v2/entitylinking/analyze");

req.headers({
  "authorization": "Bearer: YOUR_TOKEN",
  "accept": "application/json",
  "content-type": "application/json"
});

req.type("json");
req.send({
  "coherentDocument": "true",
  "confidenceThreshold": "0",
  "docId": "doc1",
  "text": "When Who played Tommy in Columbus, Pete was at his best.",
  "language": "en",
  "annotatedMentions": [
    {
      "charLength": 3,
      "charOffset": 5
    }
  ]
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "api.ambiverse.com",
  "port": null,
  "path": "/v2/entitylinking/analyze",
  "headers": {
    "content-type": "application/json",
    "accept": "application/json",
    "authorization": "Bearer: YOUR_TOKEN"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ coherentDocument: 'true',
  confidenceThreshold: '0',
  docId: 'doc1',
  text: 'When Who played Tommy in Columbus, Pete was at his best.',
  language: 'en',
  annotatedMentions: [ { charLength: 3, charOffset: 5 } ] }));
req.end();
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.ambiverse.com/v2/entitylinking/analyze',
  headers: 
   { authorization: 'Bearer: YOUR_TOKEN',
     accept: 'application/json',
     'content-type': 'application/json' },
  body: 
   { coherentDocument: 'true',
     confidenceThreshold: '0',
     docId: 'doc1',
     text: 'When Who played Tommy in Columbus, Pete was at his best.',
     language: 'en',
     annotatedMentions: [ { charLength: 3, charOffset: 5 } ] },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
HttpResponse<String> response = Unirest.post("https://api.ambiverse.com/v2/entitylinking/analyze")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .header("authorization", "Bearer: YOUR_TOKEN")
  .body("{\"coherentDocument\": \"true\", \"confidenceThreshold\": \"0\", \"docId\": \"doc1\", \"text\": \"When Who played Tommy in Columbus, Pete was at his best.\", \"language\": \"en\",  \"annotatedMentions\" : [ { \"charLength\":3, \"charOffset\":5 } ] }")
  .asString();
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"coherentDocument\": \"true\", \"confidenceThreshold\": \"0\", \"docId\": \"doc1\", \"text\": \"When Who played Tommy in Columbus, Pete was at his best.\", \"language\": \"en\",  \"annotatedMentions\" : [ { \"charLength\":3, \"charOffset\":5 } ] }");
Request request = new Request.Builder()
  .url("https://api.ambiverse.com/v2/entitylinking/analyze")
  .post(body)
  .addHeader("content-type", "application/json")
  .addHeader("accept", "application/json")
  .addHeader("authorization", "Bearer: YOUR_TOKEN")
  .build();

Response response = client.newCall(request).execute();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.ambiverse.com/v2/entitylinking/analyze",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"coherentDocument\": \"true\", \"confidenceThreshold\": \"0\", \"docId\": \"doc1\", \"text\": \"When Who played Tommy in Columbus, Pete was at his best.\", \"language\": \"en\",  \"annotatedMentions\" : [ { \"charLength\":3, \"charOffset\":5 } ] }",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer: YOUR_TOKEN",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
<?php

$request = new HttpRequest();
$request->setUrl('https://api.ambiverse.com/v2/entitylinking/analyze');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'authorization' => 'Bearer: YOUR_TOKEN',
  'accept' => 'application/json',
  'content-type' => 'application/json'
));

$request->setBody('{"coherentDocument": "true", "confidenceThreshold": "0", "docId": "doc1", "text": "When Who played Tommy in Columbus, Pete was at his best.", "language": "en",  "annotatedMentions" : [ { "charLength":3, "charOffset":5 } ] }');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"coherentDocument": "true", "confidenceThreshold": "0", "docId": "doc1", "text": "When Who played Tommy in Columbus, Pete was at his best.", "language": "en",  "annotatedMentions" : [ { "charLength":3, "charOffset":5 } ] }');

$request->setRequestUrl('https://api.ambiverse.com/v2/entitylinking/analyze');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Bearer: YOUR_TOKEN',
  'accept' => 'application/json',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.ambiverse.com/v2/entitylinking/analyze",
  "method": "POST",
  "headers": {
    "content-type": "application/json",
    "accept": "application/json",
    "authorization": "Bearer: YOUR_TOKEN"
  },
  "processData": false,
  "data": "{\"coherentDocument\": \"true\", \"confidenceThreshold\": \"0\", \"docId\": \"doc1\", \"text\": \"When Who played Tommy in Columbus, Pete was at his best.\", \"language\": \"en\",  \"annotatedMentions\" : [ { \"charLength\":3, \"charOffset\":5 } ] }"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var data = JSON.stringify({
  "coherentDocument": "true",
  "confidenceThreshold": "0",
  "docId": "doc1",
  "text": "When Who played Tommy in Columbus, Pete was at his best.",
  "language": "en",
  "annotatedMentions": [
    {
      "charLength": 3,
      "charOffset": 5
    }
  ]
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.ambiverse.com/v2/entitylinking/analyze");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "Bearer: YOUR_TOKEN");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("api.ambiverse.com")

payload = "{\"coherentDocument\": \"true\", \"confidenceThreshold\": \"0\", \"docId\": \"doc1\", \"text\": \"When Who played Tommy in Columbus, Pete was at his best.\", \"language\": \"en\",  \"annotatedMentions\" : [ { \"charLength\":3, \"charOffset\":5 } ] }"

headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "Bearer: YOUR_TOKEN"
    }

conn.request("POST", "/v2/entitylinking/analyze", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "https://api.ambiverse.com/v2/entitylinking/analyze"

payload = "{\"coherentDocument\": \"true\", \"confidenceThreshold\": \"0\", \"docId\": \"doc1\", \"text\": \"When Who played Tommy in Columbus, Pete was at his best.\", \"language\": \"en\",  \"annotatedMentions\" : [ { \"charLength\":3, \"charOffset\":5 } ] }"
headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "Bearer: YOUR_TOKEN"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
var client = new RestClient("https://api.ambiverse.com/v2/entitylinking/analyze");
var request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Bearer: YOUR_TOKEN");
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"coherentDocument\": \"true\", \"confidenceThreshold\": \"0\", \"docId\": \"doc1\", \"text\": \"When Who played Tommy in Columbus, Pete was at his best.\", \"language\": \"en\",  \"annotatedMentions\" : [ { \"charLength\":3, \"charOffset\":5 } ] }", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.ambiverse.com/v2/entitylinking/analyze");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: Bearer: YOUR_TOKEN");
headers = curl_slist_append(headers, "accept: application/json");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"coherentDocument\": \"true\", \"confidenceThreshold\": \"0\", \"docId\": \"doc1\", \"text\": \"When Who played Tommy in Columbus, Pete was at his best.\", \"language\": \"en\",  \"annotatedMentions\" : [ { \"charLength\":3, \"charOffset\":5 } ] }");

CURLcode ret = curl_easy_perform(hnd);
require 'uri'
require 'net/http'

url = URI("https://api.ambiverse.com/v2/entitylinking/analyze")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["authorization"] = 'Bearer: YOUR_TOKEN'
request.body = "{\"coherentDocument\": \"true\", \"confidenceThreshold\": \"0\", \"docId\": \"doc1\", \"text\": \"When Who played Tommy in Columbus, Pete was at his best.\", \"language\": \"en\",  \"annotatedMentions\" : [ { \"charLength\":3, \"charOffset\":5 } ] }"

response = http.request(request)
puts response.read_body
#import <Foundation/Foundation.h>

NSDictionary *headers = @{ @"content-type": @"application/json",
                           @"accept": @"application/json",
                           @"authorization": @"Bearer: YOUR_TOKEN" };
NSDictionary *parameters = @{ @"coherentDocument": @"true",
                              @"confidenceThreshold": @"0",
                              @"docId": @"doc1",
                              @"text": @"When Who played Tommy in Columbus, Pete was at his best.",
                              @"language": @"en",
                              @"annotatedMentions": @[ @{ @"charLength": @3, @"charOffset": @5 } ] };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.ambiverse.com/v2/entitylinking/analyze"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

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];
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.ambiverse.com/v2/entitylinking/analyze"

	payload := strings.NewReader("{\"coherentDocument\": \"true\", \"confidenceThreshold\": \"0\", \"docId\": \"doc1\", \"text\": \"When Who played Tommy in Columbus, Pete was at his best.\", \"language\": \"en\",  \"annotatedMentions\" : [ { \"charLength\":3, \"charOffset\":5 } ] }")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer: YOUR_TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}