Economist Intelligence Unit Integration
Requirements:
- Username
- Password
- API Key
-------------------------------------------------------------------------------------------------------
Getting an account and signing in
To use any of our APIs, you must obtain a developer account. A developer account provides an API key for accessing our APIs, a graphical user interface for testing our APIs, and API usage metrics. To get an account, contact your account manager.
Once you have an account, sign in using the Sign In button at the top right of the title bar.
Subscribing to APIs
After signing in, click My Dashboard to see your new API key. It won't yet be linked to any of our APIs. To activate it for a particular API, click APIs, select the API you want in the list and click Subscribe. Your API key will then be subscribed to the API and you can make calls to its methods.
https://developer.eiu.com/login
Getting a Bearer Token
A bearer token is a cryptic string generated by the server in response to a login request. You must paste this token into the Authorization dialog before you can use the other methods on the APIs page. The token lasts one hour; use it until you get an "unauthorised" response when you execute a method. At that point get a fresh token, authorise again using that one, and continue with your work.
NOTE:
You must use POST /login to obtain a bearer token, then click Authorize and enter this, before using any other method on the APIs page.
GET /helloworldauth can be used to test bearer tokens. It returns a "Hello World" message and the user's authenticated email address.
POST /login
Perform this mandatory operation first to obtain a bearer token that you can use to authorise all the other API methods.
- Click Try it out.
- Under LoginRequest enter your email address and password in the two strings:
{ "emailAddress": "string", "password": "string" }- Click Execute.
- Scroll down to the response body. A successful execution returns 200. If this is the response code, highlight and copy the string (without the surrounding " and ") that follows the word "token".
- Return to the top of the page and click Authorize. In the Available authorizations dialog, enter the word Bearer in the blank Value: field, followed by a space. Paste in the token and click Authorize. If this succeeds, the word Authorized appears in the box. Click Close.
- Subsequent requests made from the page will automatically include the correct authorization header.
curl --location --request POST 'https://api.eiu.com/v1/login' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' \ --header 'Authorization: Bearer YOUR_TOKEN' \ --data-raw '"{\n \"emailAddress\": \"YOUR_EMAIL\",\n \"password\": \"YOUR_PASSWORD\"\n }"'
