API does not work


Currently contains 2 posts


July 05, 2018 01:51

Nelvin Tan

<p>Where do I put the authentication ID in the API? Putting it in TOKENS does not help</p> <p>import http.client</p> <p>conn = http.client.HTTPSConnection(“api.ambiverse.com”)</p> <p>payload = “{\”coherentDocument\“: \”true\“, \”confidenceThreshold\“: \”0\“, \”docId\“: \”doc1\“, \”text\“: \”When Who played Tommy in Columbus, Pete was at his best.\“, \”language\“: \”en\“, \”annotatedMentions\" : [ { \charLength\, \charOffset\ } ] }"</p> <p>headers = {<br />‘content-type’: “application/json”,<br />‘accept’: “application/json”,<br />‘authorization’: “Bearer: TOKEN”<br />}</p> <p>conn.request(“POST”, “/v2/entitylinking/analyze”, payload, headers)</p> <p>res = conn.getresponse()<br />data = res.read()</p> <p>print(data.decode(“utf-8”))</p>


July 23, 2018 12:01

Ambiverse Ambiverse

<p>Hi Nelvin,</p> <p>Once you’ve obtained the token you can either put it in the header or in the query string. The header is recommended: <a href="../../overview">https://developer.ambiverse.com/overview</a></p> <p>In your code, I see one small error. You don’t need ‘:’ after Bearer The correct should be ‘authorization’: ‘Bearer TOKEN’. Please refer to the documentation link above. </p> <p>Hope this solves your problem.</p> <p> </p>
Reply to thread