Private APIs

The basics

Picture
Picture

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.

Picture

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

Picture

Request Header: Jwt

Value: How topending 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.

Picture

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

Picture

Promoting your application to Production

On the top of the page, make sure you are on “Production Environment” 

1. In order to call any API in Production, you must have a valid subscription key, that you can request by creating an application in the tab Products. To do so, select the type of API you want to create a new App.

2. On the bottom of the detail API Product you have already selected, fill the textbox with the desired name of your new App.

3. Accept API Terms and Conditions.

4. Click on the Subscribe button.

5. On the section Subscription Management under the menu Account, you will find your created app with the subscription.

Picture

ABOUT

CEMEX is a global building materials company that provides high-quality products and reliable service to customers. See more.

Learning Hub   |   CEMEX Go

Copyright © 2020, CEMEX International Holding AG. All rights reserved.