身份验证

OAuth 2.0
API access will require OAuth 2.0 authentication which in-turn will require technical user for a particular distributor in Schneider authentication system.
To request credentials please email: distributorapiportal.global@se.com

How OAuth works:

  1. API user need to have static client-id and secret key along with token generation endpoint from API provider.
  2. Using above details, Token API needs to be called with POST method.
  3. This API will return Bearer token, which can be used for 1 hour to call API, this can be treated as dynamic credential which has expiry of one hour.
Environment Token generation Endpoint
QA https://api.qa.se.com/token
Pre-prod https://api.preprod.se.com/token
Production https://api.se.com/token


How to generate token using Postman:

  1. Create New API request with actual API endpoint 
  2. Go to Authorization section
  3. Select Type as OAuth 2.0
  4. On right side, go to Configure New Token
  5. Token name can be user defined (e.g., distributor name)
  6. Grant Type = Client Credentials (Select from drop down)
  7. Access Token URL will be as per above table
  8. Client ID and Client Secret will be given by Schneider team
  9. Scope all
  10. Client Authentication can be Send Client Credentials in body
  11. Click on Get New access token 

Postman Reference

Postman Token Detail


Token Generation Sample using new Postman request:

 

  1. Select POST and enter the Token URL. 
  2. From the Body tab, click on radio button x-www-form-urlencoded. 
  3. Manually enter Key and Value, “grant_type” and “client_credentials”. 
  4. From the Authorization tab, select Type “Basic Auth”. 
  5. Set Username to the client key (provided to you offline). 
  6. Set Password to the client secret (provided to you offline). 
  7. Send request and retrieve value of access_token from the response message. 

 
Token Generation Request Creation using CURL in Postman:

  1. In postman, select Import option (which is on the upper left).
  2. On the Import dialog, select Raw text and paste the curl sample provided below.
  3. Click Continue and then Import.
  4. From the Headers tab, replace the Authorization value with the Base-64 encoded string of client_key and client_secret.

 
Sample curl for Token Generation:
curl --location --request POST 'https://api.se.com/token' \
--header 'Authorization: Basic askjdfsaldalskjfdlsajflasdkjfb2h4NVJxMFlSZ2hUbA==' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials'


API-Key
For few APIs, access using API-key is also feasible where you provide the long-lived apikey as a query parameter.
Once you have an apikey, you can exercise GET operations directly in a web browser. 
URL format: https://{hostname}/{BaseURL}/{ResourcePath}?{queryParams}&apikey={your_api-key}

Change your cookie settings