Private APIs
The basics
Create a new application
Select the corresponding API product(s) on the section Products.
On the bottom on the API product detail, fill the text box with a name of your desired new App.
Accept API Terms and Conditions.
Click on the Subscribe button.
Your application will be created.
Register an application
Log in the Developer Center to access private APIs. In order to call any API, you must have a valid subscription key that you can request by creating an application in Products tab.
This subscription key is used in identifying you and your application, so it must be sent as part of the http request header as Ocp-Apim-Subscription-Key
.
Getting your Subscription Key
From Subscription Management, click on your registered app to go into its detail view. You’ll see a subscription key for each of the selected (and approved) API products. This subscription key is a required request header parameter.
Each product has a different subscription key.
Partner and Private API products are internally approved and go through an internal approval process.
Approval may take 48 hours.
Private APIs
The private APIs are the ones that need the parameter such as
Accept, Accept-Language, App-Code, Jwt
and
Authorization
.
Getting your authentication tokens
Additional to the subscription key, authorization token and JWT are required in every partner and private API request header.
These tokens are obtained by calling the authenticity service and including in the request body of your CEMEX Go credentials.
The service will respond with an authorization access token and a JWT.
Get request header parameter for Private APIs
Request Header:
Jwt
Value:
How to
pending inf
---
Request Header:
Authorization
Value:
Bearer
+ access_token.
Example:
Bearer eyJhbGciOiJIU...
How to
---
Request Header:
Ocp-Apim-Subscription-Key
Value:
From your dashboard, click on your registered app to go into its detail view. You’ll see a
subscription key
for each of the selected (and approved) API products
Example:
9b5c500042c6497da43240...
Request Header:
Accept
Value:
Application/json
---
Request Header:
Accept-Language
Value:
A language tag (which is sometimes referred to as a "locale identifier") consists of a 2-3 letter base language tag representing the language, optionally followed by additional subtags separated by '-'. The most common extra information is the country or region variant.
Example:
en-US
---
Request Header:
App-Code
Value:
App ID
registered on the Developer Portal through the Dashboard, the App ID is defined on the section
Create New App
Example:
TestApp
Header parameter:
Content-Type
Value:
application/x-www-form-urlencoded
---
Body parameter:
grant-type
Value:
Password
---
Body parameter:
scope
Value:
Security
-----
Body parameter:
username
Value:
CEMEX Username
---
Body parameter:
password
Value:
CEMEX Password
Get JWT value
Use the following API https://openapi.cemexgo.com/v2/secm/oam/oauth2/token
then set the following Request Headers and Body Parameters to get JWT value.
Header parameter:
Content-Type
Value:
application/x-www-form-urlencoded
---
Body parameter:
grant_type
Value:
Password
---
Body parameter:
scope
Value:
Security
-----
Body parameter:
username
Value:
CEMEX Username
---
Body parameter:
password
Value:
CEMEX Password
Get Authorization Value using CEMEX Go credentials (First time)
Header parameter:
Content-Type
Value:
application/x-www-form-urlencoded
---
Body parameter:
grant_type
Value:
refresh_token
---
Body parameter:
scope
Value:
Security
-----
Body parameter:
refresh_token
Value:
Refresh token value
Get Authorization Value using refresh token value