Skip to content

Commit 45fbb16

Browse files
committed
feat: add generate api secret key
1 parent 117716a commit 45fbb16

9 files changed

Lines changed: 78 additions & 0 deletions

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
![1](../../../static/img/sql-account-api/generate-api-secret-key/1.png)
23+
24+
3. **Generate Secret Key:**
25+
26+
**Click** on `Generate API Secret Key`
27+
28+
![2](../../../static/img/sql-account-api/generate-api-secret-key/2.png)
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+
![3](../../../static/img/sql-account-api/generate-api-secret-key/3.png)
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+
![4](../../../static/img/sql-account-api/generate-api-secret-key/4.png)
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+
![5](../../../static/img/sql-account-api/generate-api-secret-key/5.png)
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+
![postman-1](../../../static/img/sql-account-api/generate-api-secret-key/postman-1.png)
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+
![postman-2](../../../static/img/sql-account-api/generate-api-secret-key/postman-2.png)
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+
![postman-3](../../../static/img/sql-account-api/generate-api-secret-key/postman-3.png)
8.94 KB
Loading
3.07 KB
Loading
6.61 KB
Loading
5.66 KB
Loading
5.48 KB
Loading
27 KB
Loading
49.9 KB
Loading
57.3 KB
Loading

0 commit comments

Comments
 (0)