|
1 | | -## Postman |
| 1 | +# Postman |
| 2 | + |
| 3 | +## OAuth Access Token |
| 4 | + |
| 5 | +### Steps |
| 6 | + |
| 7 | +1. Install [Postman](https://www.getpostman.com/downloads/) |
| 8 | + |
| 9 | +2. Open Postman |
| 10 | + |
| 11 | +3. Create a `new request`. |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +4. Click on `Authorization` and select `OAuth 2.0` from Type dropdown menu. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +5. Click on `Get New Access Token`. |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +6. Copy your `API Key (Client ID)`, `Client Secret` and the `Default Redirect URI` from your Adobe Developer Console integration and paste it in the Postman `GET NEW ACCESS TOKEN` window. Assuming you are trying to get an access token for Adobe Analytics use below for scope: |
| 24 | +``` |
| 25 | +openid,AdobeID,read_organizations,additional_info.projectedProductContext,additional_info.job_function |
| 26 | +``` |
| 27 | + |
| 28 | +*Note: If you are not sure about scope, refer to [Scope Reference](../OAuth/Scopes.md).* |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +7. You will be prompted for login by Adobe. Login using your Adobe ID. |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +8. Your access token will be generated. |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +## JWT Access Token |
| 41 | +### Steps |
| 42 | +1. Go to [Adobe Developer Console](https://developer.adobe.com/console) |
| 43 | + |
| 44 | +2. Open the Service Account Integration for which you want to generate an access token. |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +3. Click on the JWT tab, paste the entire private key file content including the `-----BEGIN PRIVATE KEY-----` and `-----END PRIVATE KEY-----` and click on `Generate JWT`. |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +4. Copy the `Sample CURL command` and open Postman. (*Mac and Linux user can also paste the CURL command in terminal and get the access token.*) |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +5. Click on `Import` -> `Paste Raw Text` and paste the CURL command. |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +6. Click on `Send`. You will receive an access token. |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +## CURL Requests in Windows |
| 65 | + |
| 66 | +In API Documentation, sample CURL requests are common and helpful for the developers. Mac and Linux terminals are capable of executing such CURL requests but the Windows command prompt doesn't support it out of the box. |
| 67 | + |
| 68 | +For windows users, you can follow below steps to execute the CURL requests easily by using Postman. |
| 69 | + |
| 70 | +### Steps |
| 71 | + |
| 72 | +1. Copy the CURL Request. |
| 73 | +e.g. |
| 74 | +``` |
| 75 | +curl https://stock.adobe.io/Rest/Media/1/Search/Files?locale=en_US%26search_parameters%5Bwords%5D=kittens |
| 76 | + -H 'x-api-key:myAPIKey' |
| 77 | + -H 'x-product:myTestApp1.0' |
| 78 | + ``` |
| 79 | + |
| 80 | + 2. Open Postman. Click `Import` -> `Paste Raw Text` -> Paste the CURL request. |
| 81 | + |
| 82 | +  |
| 83 | + |
| 84 | + 3. Go to `Headers` tab and replace `myAPIKey` with your actual API Key from Adobe Developer Console integration for Adobe Stock. |
| 85 | + |
| 86 | +  |
| 87 | + |
| 88 | + 4. Click Send. You will receive a response. |
| 89 | + |
| 90 | +  |
| 91 | + |
| 92 | + *Note: You can import any CURL Request into Postman by following the above steps.* |
0 commit comments