Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Open PermID /
avatar image
Question by steven.hagene · Mar 07, 2019 at 02:50 PM · apipermiderrorx-ag-access-token

Trying to use permid file match and receive error Failed to resolve API Key variable request.header.X-AG-Access-Token

Good day

I am trying to use permID file match by hitting https://api.thomsonreuters.com/permid/match/file

I can use the entity search API with no errors, but with the file match I am getting the following error
{ "fault": { "faultstring": "Failed to resolve API Key variable request.header.X-AG-Access-Token", "detail": { "errorcode": "steps.oauth.v2.FailedToResolveAPIKey" } } }

I am currently using postman to test and am unsure of what I am doing wrong.


When using this access token in the Dev Tools try it out section, I do not receive an error.

Any help is appreciated.

Steven

screen-shot-2019-03-07-at-24817-pm.png (128.1 KiB)

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by jirapongse.phuriphanvichai · Mar 08, 2019 at 01:20 AM

I have modified the code.

1. The path should start with "/"

2. Add the "x-ag-access-token" in the headers

3. Add content in the body

The modified code is:

var http = require("https"); 

var options = { "method": "POST", "hostname": "api.thomsonreuters.com", "path": "/permid/match/file", "headers": { "content-type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", "x-openmatch-numberOfMatchesPerRecord": "1", "x-openmatch-dataType": "Organization", "cache-control": "no-cache", "Postman-Token": "101e3dbe-96bf-4b1c-9fce-8dad5f4ff975", "x-ag-access-token" : "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("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"file\"; filename=\"test.csv\"\r\nContent-Type: application/vnd.ms.-excel\r\n\r\nLocalID,Standard Identifier,Name,Country,Street,City,PostalCode,State,Website\r\n1,,Apple,US,\"Apple Campus, 1 Infinite Loop\",Cupertino,95014,California,\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--");
 
req.end(); 
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Alex Putkov. · Mar 07, 2019 at 04:22 PM

According to chapter 2.3 of PermID API User Guide, if you want to pass access token as a parameter in the URL rather than as an HTTP header, the parameter name is "access-token" and not "x-ag-access-token".

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by steven.hagene · Mar 07, 2019 at 04:55 PM

After updating my node code i get the following back in terminal after trying to run node.
$ node index.js <!DOCTYPE html> <html> <head> <title>Error</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>An error occurred.</h1> <p>Sorry, the page you are looking for is currently unavailable.<br/> Please try again later.</p> </body> </html>

Below is the code in index.js

const express = require('express')
const app = express()


const request = require('request');
const cors = require('cors');
// const http = require('http');
// const https = require('https');
const util = require('util')


// Sets an initial port. We"ll use this later in our listener
const PORT = process.env.PORT || 8080;


app.use(cors());

var corsOptions = {
  origin: '*',
  optionsSuccessStatus: 200
};

// Service end-point (search) 

// app.get('/upload', function (req, res) {

//   var options = {
//     method: 'GET',
//     url: 'https://api.thomsonreuters.com/permid/match/file?Content-Type=multipart%2Fform-data',
//     headers: {
//       'cache-control': 'no-cache',
//       'x-openmatch-dataType': 'Organization',
//       'x-openmatch-numberOfMatchesPerRecord': '1',
//       'x-ag-access-token': '96CT8NAgnieeuiYA2YPeNMnbPMfHu4W8'
//     },
//     formData: {
//       file: undefined
//     }
//   };

//   request(options, function (error, response, body) {
//     if (error) throw new Error(error);
//     console.log(response)
//     console.log(body);
//   });

// });

// function dataReturned(e) {
//   console.log("Success!");
//   finalRes.end(e);
// }

// const server = http.createServer(app)
// server.listen(PORT, () => {
//   console.log(`app started! at port ${PORT}`);
// });
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "api.thomsonreuters.com",
  "path": "permid/match/file",
  "headers": {
    "content-type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
    "x-openmatch-numberOfMatchesPerRecord": "1",
    "x-openmatch-dataType": "Organization",
    "cache-control": "no-cache",
    "Postman-Token": "101e3dbe-96bf-4b1c-9fce-8dad5f4ff975"
  }
};

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("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--");
req.end();

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Alex Putkov. · Mar 07, 2019 at 05:09 PM

To troubleshoot this I suggest you capture the HTTP request and response going on the wire. Use an HTTP analyzer or a network sniffer.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
9 People are following this question.

Related Questions

What is the rate limit for permid APIs?

processing organization bulk download using node js

PermId Search API sometimes returns no match even though data is available

Open PermID API - How to download Organisation AND Persons data?

PermId Organisation RSS Feed no longer returning any data

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges