|
| 1 | +--- |
| 2 | +sidebar_position: 2 |
| 3 | +id: generate-api-secret-key |
| 4 | +title: Generate API Secret Key |
| 5 | +description: A guide to generate SQL Account API secret key |
| 6 | +slug: /sql-account-api/generate-api-secret-key |
| 7 | +tags: ["SQL Account", "SQL Account API", "Generate API Secret Key"] |
| 8 | +--- |
| 9 | + |
| 10 | +This guide will walk through generating `API Secret Key`, which allow the user to access SQL Account API Services. |
| 11 | + |
| 12 | +## Step to Generate API Secret Key |
| 13 | + |
| 14 | +1. **Navigate to User Detail:** |
| 15 | + |
| 16 | + Go to `Tools` > `Maintain User...` > `Detail` |
| 17 | + |
| 18 | +2. **Select API Secret Key Option:** |
| 19 | + |
| 20 | + **Click** on `More` > `API Secret Key` |
| 21 | + |
| 22 | +  |
| 23 | + |
| 24 | +3. **Generate Secret Key:** |
| 25 | + |
| 26 | + **Click** on `Generate API Secret Key` |
| 27 | + |
| 28 | +  |
| 29 | + |
| 30 | + :::warning[Important Note] |
| 31 | + Once an `API Secret Key` is generated for a user, that user will no longer be able to login on SQL Account directly. The user only be able to access `SQL Account API Service` with the secret key generated. |
| 32 | + ::: |
| 33 | + |
| 34 | +4. **Copy and Save Secret Key** |
| 35 | + |
| 36 | + The API `Access Key` and `Secret Key` will displayed. Make sure to copy and save it immediately in a secure location. |
| 37 | + |
| 38 | +  |
| 39 | + |
| 40 | + :::info[Tip] |
| 41 | + **API Secret Key** can only be retrieved at the time of generated. If you lose it, you can `revoke` and `generate` a new API Secret Key. |
| 42 | + ::: |
| 43 | + |
| 44 | +## Test AWSv4 Signature with API Secret Key |
| 45 | + |
| 46 | +`SQL Account API Service` uses [AWS Signature Version 4](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html) for authenticating requests. You can **click** on `Test Connection` to test on the request with AWSv4 authorization header. |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +:::info[Hints] |
| 51 | +For a sample cURL request with AWSv4 authorization header, **click** on `Copy`. |
| 52 | +::: |
| 53 | + |
| 54 | +## Download and Import SQL Account API Postman Collection |
| 55 | + |
| 56 | +1. **Download Postman Collection:** |
| 57 | + |
| 58 | + **Click** on `Download Postman Collection` to save `postman_collection.json` file. |
| 59 | + |
| 60 | +  |
| 61 | + |
| 62 | +2. **Import the API specification into your Postman application:** |
| 63 | + |
| 64 | + **Click** on `Import`, then select `postman_collection.json` file you downloaded to import. |
| 65 | + |
| 66 | +  |
| 67 | + |
| 68 | +3. **Update Access Key and Secret Key:** |
| 69 | + |
| 70 | + After postman collection imported, **navigate** to `Variables` tab. Then, **replace** the `your_access_key` and `your_secret Key` with the Access Key and Secret Key generated earlier. |
| 71 | + |
| 72 | +  |
| 73 | + |
| 74 | +4. **Test on API Endpoint** |
| 75 | + |
| 76 | + **Select** on `Agent` endpoint. Then, **click** on `Send` to try retrieve agent data from `SQL Account API Service` and the `Agent` json data list will show on response body. |
| 77 | + |
| 78 | +  |
0 commit comments