Edge API (via Postman)
A Postman collection is available for download. The edge-postman.json file is intended to be imported into the Postman app. Once imported, you will have an easy means to call any of our supported API endpoints.
Prerequisites
These instructions assume that you have Edge installed and that you have access via your own personal user account. Many of these endpoints require an API key to call (which you can get from the "My Account" page in Edge). Many of these endpoints also require admin access in order to get a successful response.
Setup
Here are some basic steps you can follow to get started...
Import
Open up Postman and import the Edge API collection (named edge-postman.json, which is located in the same directory as this README file). Once completed, you should see a new collection on the left panel called "Edge". You can click on this to expand the collection and see that there are several collections available to you. Click on the "Access Tokens" collection and you will find an API endpoint called "Obtain an access token". Click on this to open it in a new tab.
Environments
You will see in the URL bar that the auth endpoint is defined as "{{URL}}/api/v2/auth". All of the endpoints require that this URL variable be defined. Before we can call an endpoint, we will need to define that "URL" variable. But first, we will add an environment to add these variables to.
- Click on the button with a picture of an eye at the top-right corner.
- Click the "Add" button.
- Give your new Environment a unique and meaningful name.
- Within the table in this view, under the VARIABLE column, add "URL". Add the value of the URL for your installation of Edge (i.e. https://my-controller-host.com:8001). Please note that the REST API port will be 8001 and not 8000, unless you changed this in the configuration.
- Add a value for
API_KEY
as well. - Save the settings.
- Select the new environment from the Environments dropdown.
Call your first endpoint
- Go back to your list of collections and expand the "System" sub-collection.
- Click on "Retrieve Edge installation information". This should open it in a new tab.
- Assuming that you have selected an environment that has the "URL" variable defined, simply click on the "Send" button.
- You should receive a JSON response that holds release-related information for your installation of Edge.
Advanced requests
- Many of our requests require extra data to be provided in order to be called. Click on the "Translations" collection and click on "Create a translation (async)" to open it up.
- You will see a sub menu for this endpoint with options like "Params", "Authorization", "Headers", "Body", etc. If you click on the "Body" sub-menu, you will see that there are a number of fields defined. Many of them are optional for this endpoint (as seen in the Description column).
- To call this endpoint, fill in the languagePairId (you can call the "List Language Pairs" endpoint in the "Language Pairs" collection to get this data) and the input field (this data must be base64-encoded).
- For most endpoints (including this one), you will need to supply a form of
authentication. Most of the endpoints in Postman are setup to use an API
key. Please click on the "Authorization" sub-menu to see that "Basic Auth"
is selected and that the username is pointing to a variable. Be sure set
this variable with your own API key. There are two ways to obtain this key:
- Login to Edge and go to your "My Account" page, or
- Under the "Users" collection, call the "Retrieve API Credentials for the current user". You will need to get an access token from the "Obtain Access Token" endpoint to call this.
- Click the "Send" button. If successful, it will give you an ID for the submitted translation job. If you login to Edge, you should see that job in the queue.
Documentation
Postman is thoroughly documented here. You are encouraged to read through this documentation in order to get the most out of your experience. Here are a few links that we recommended...