TuGo API Forums

General

RSS Feed

HTTP GET headers

    • dannychoi
    • Topic created 8 years ago

    I am trying to send a GET request to pull country information and I am getting a 403 error when I set the headers. I am using angularJS to build the request like so,

    exports.getMessages = function () { return $http({ url:'https://api.tugroup.com/v1/travelsafe/countries/ar', headers: { 'X-Auth-Token': 'myKey'}, method: 'GET' }).success(function(data){ return data; }); };

    returns this message GET https://api.tugroup.com/v1/travelsafe/countries/ar 403 (Forbidden)

    Is there another header that needs to be added?

    Message edited by dannychoi 8 years ago

    Tags

  1. zbak8 years ago

    Hi dannychoi,

    You are getting that response because the header parameter is incorrect. Instead of using "X-Auth-Token", you should use "X-Auth-API-Key".

    Please see the example curl request that is provided in the documentation, or check out or IO docs for an interactive example.

    Thanks, Zareef

  2. vishnu mohan s8 years ago

    how to make it work on php

[ Page 1 of 1 ]