The "Refresh Access Token" request will automatically put that new Access Token into your environment, and it will be used for subsequent requests. You should see a JSON response showing the new access token. Open the "Refresh Access Token" request within the "OAuth" folder, and send the request. To generate the Access Token we need, we'll use the API to create one using the Refresh Token we saved in the environment. As there isn't an Access Token set, the request will fail with a status code of 401 and an error returned in the body that it's an invalid token. When you created the integration in the steps above, one was included in the response, but we didn't copy that over.Īs a quick test, try to execute the "Store Home" request within the "Home" folder. That token acts as your password for accessing the protected resource - in this case, your store. You're now all set to start interacting with the Hypermedia API in Postman! Generating an Access TokenĪn important aspect for actually communicating with the API though is through the Access Token. In the top right area of Postman, in the environment dropdown (it will probably show "No Environment" by default), select the environment you just created.Click the "Add" button to create the environment, and close the "Manage Environments" panel.Copy and paste the values for client_id, client_secret and refresh_token into the matching environment variables you created in Postman in step 4. On success, you'll see some credentials for your new OAuth client.Under "Current Integrations" click the "Get Token" button, complete the two fields that appear for name and description (for example "Postman Client" and "Trying out the API with Postman") and click "Create Integration".Login to the Fox圜art administration, select the store you want to use with the API, and go to the "Integrations" page.Create three keys for client_id, client_secret and refresh_token. Give it a name of the store that you'll be utilising with the API. In Postman, click the "New" button and select "Environment".With the collection imported, we now need to create an OAuth integration for your store, and set up an environment in Postman to store those credentials: Select "Import from link", paste in this link: and click "Import". You can also import the collection manually in the app by clicking the "Import" button in top left.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |