Appearance
Connect Shopee
POST/public/account/shopee/connectCompletes the Shopee connection by exchanging the authorization code received from the OAuth redirect. On success, returns the new account ID.
Endpoint Details
- Authentication: Basic Auth (
Authorization: Basic Base64(AccessKey:SecretKey)) - Access Tier: Gold+
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Authorization code received from the OAuth redirect. |
Example Request
bash
curl -X POST "https://api.repliz.com/public/account/shopee/connect" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{"code":"AUTH_CODE_FROM_REDIRECT"}'javascript
import axios from 'axios';
const response = await axios.post(
'https://api.repliz.com/public/account/shopee/connect',
{
code: 'AUTH_CODE_FROM_REDIRECT',
},
{
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY',
},
},
);
console.log(response.data);javascript
const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const response = await fetch(
'https://api.repliz.com/public/account/shopee/connect',
{
method: 'POST',
headers: {
Authorization: `Basic ${credentials}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
code: 'AUTH_CODE_FROM_REDIRECT',
}),
},
);
const data = await response.json();
console.log(data);Response
json
{
"accountId": "69e97477a795504e0786cec6"
}json
{
"code": 401,
"message": "unauthorized"
}