1 Minute Read
Oath/Token
Oauth/token is the POST API for retrieving token for authentication by the external API User to be part of the 75F Platform and further use other APIs in the system. It is basically the Client Application credentials. The token provided here expires with 24 hours and it needs to be re-activated to access other APIs. So the refresh rate for this token renewal is 24 hours.
Request
POST https://api-management-75f-dev.azure-api.net/oauth/token
Request headers
Name : Content-Type
Required : True
Request body
grant_type=client_credentials&client_id=user&client_secret=pass
Note: The parameters passed above in the query is:
Client ID : Username which is part of 75F Facilisight App that provides access to the Developer for a certain set of buildings
Client Secret : password that is used with the 75F system mentioned about
Response: 200 OK
The provided credentials are valid and an OAuth token was successfully created.
application/json: {"access_token":"df7asd8f6as6df678as6df7astdrfasf67as8df7gyhasidv","token_type":"bearer","expires_in":"3600"}
Response: 401 Unauthorized
Invalid credentials provided
Procedure to Generate a Token
From the Developer portal home page
- Click the Profile option.
The user profile screen is displayed with the user details, and the details related to the subscriptions subscribed for.
Under the products subscribed for, locate the subscription key for the relevant product.
For this example we are trying use the product Product Production Readonly subscription.
- Click the option show to view the subscription keys or simply copy the subscription key to be used to generate the Bearer token.
- Click the API's option on the top.
The API's screen is displayed with the list of API's the user is authorized to use.
- Click the API 75F Auth.
The 75F Auth API screen is displayed with the details about the API.
- Click Try it to access the API.
The Try it window to try the API and generate the bearer token in displayed.
- Select the Primary: Product Production Readonly Subscription under the subscription key field.
- Paste the subscription key copied from the profile screen into the header option Ocp-Apim-Subscription-Key.
Scroll further to locate the Body section as shown below
Enter the user credentials in the format specified, parts of the id and password are masked for security purpose.
grant_type=client_credentials&client_id=user&client_secret=pass
as shown below.
grant_type=client_credentials&client_id=abcdefg@75f.io&client_secret=xyz@0869
Where the user email ID replaces user&client and the password replaces pass
- Click Send to send the request and generate the bearer token.
The response is generated.
The Bearer token is generated as show below along with the response.
- Copy the bearer token and use the same in the other API requests.
Comments
0 comments
Please sign in to leave a comment.