Overview
How to use the API 'Try It' feature
8min
the "try it!" feature allows you to run sample requests directly from the browser and view an actual response from the endpoint in this topic, we show you how to use the feature using the create entity type endpoint for more information about entity types, see entity prerequisites to use the "try it!", you must first create an account in the os1 platform developer portal https //docs getos1 com/ and register an app for more information about creating an account, see getting started with the os1 platform (previous version) docid\ x9u9bnas1hvlhoetumlh5 for more information about registering an app, see getting started with building apps docid\ pimc8bwv2 c2qtgzc rvv setting up the base url in the url field, select base url and enter the tenant url of the app you registered api authentication service (backend) apps on the os1 platform apis use an access token to authenticate with the platform you can use the client id and client secret of the app that you registered to generate an access token for testing purposes generate an access token to generate an access token use the client credentials grant token docid\ rhpne4e5kfokvbcgbccbr endpoint enter the following body parameters and headers to make a request clientid clientsecret x coreos request id enter a unique random identifier for example, request123 π client id and secret you will get the client id and secret after registering an app on os1 platform developer portal for more information about registering an app, see getting started building apps select 'try it!' to request the access token access token expiry the access token has an expiry date if after running an api, it says the token is expired, you can simply generate a new one by following the steps mentioned previously using the 'try it' feature the next step is to choose an endpoint from the left hand side navigation and start to build your request here, we will try out the entity type step 1 enter path parameters appid this is the id of the app it is a string of 1 to 64 characters in length pattern ^\[a za z0 9]\[a za z0 9 ]{0,63} for testing, you can use testapp1 step 2 enter required body parameters name plural plural name of entity type for testing purposes, enter a string of 1 to 16 characters in length pattern ^\[a za z0 9]{1,16}$ for example, vehicles name singular singular name of entity type for testing purposes, enter a string of 1 to 16 characters in length pattern ^\[a za z0 9]{1,16}$ for example, vehicle step 3 enter the required headers x coreos request id enter a unique random identifier for example, request123 x coreos tid the tenant id you got after creating the app on os1 developer portal x coreos access the access token generated using the client id and secret step 4 run the endpoint to run the endpoint, select βtry itβ the response is displayed below the request example π you are now ready to explore other areas of the os1 platform apis