xDB Cloud service REST API explained

How to use REST API reference for the xDB Cloud service is described well here. But for someone it will use it for the first time may not be that obvious. Here is a description “for dummies”.

First we have to obtain valid authentication token to make a call to xDB Cloud API. it must to be included as a HTTP header in all requests. Here are a description of this call.  I use Fiddler as a tool.

SSO

  1. Open a composer tab
  2. Make sure that you set POST as HTTP method
  3. Paste endpoint URL  https://gateway-sso-scs.cloud.sitecore.net/api/License/Encode
  4. Past the whole content of your licence.xml file
  5. Click on Execute button.

token

You should receive a response with two values:

  • Key=X-Scs-Nexus-Auth
  • Value={Your Auth Token Here}

You must copy this token.

Secondly, make a call to any other endpoint. I will describe Get xDB consumption

consumption

  1. In Fiddler, open Composer tab
  2. Make sure that you set GET as HTTP method
  3. Make sure that you set HTTP/1.1 as protocol
  4. Paste endpoint URL  https://gateway-xdb-scs.cloud.sitecore.net/api/xdb/Consumption/XXXXXXXXXX/deploymentid/2017/6
  5. Paste  authentication token obtained in previous step into header:
    X-ScS-Nexus-Auth: SDRzSUFBQUF…
  6. Click on Execute button.

Results

To get results in nice  readable format I am using https://json-csv.com to convert RAW jason into CSV.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s