English
English
Appearance
English
English
Appearance
https://api.repliz.com/public/account/instagram/connect/{accountId}Reauthorize a previously connected Instagram account, typically when the session has expired. Provide a new authorization code from the Instagram callback.
Authorization: Basic Base64(AccessKey:SecretKey))| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | ID of the account to reconnect, the _id from Get Account. The user has to sign in with the same Instagram account, or the call returns 400. |
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | The code query parameter from the URL Instagram redirected the user to. It works only once and expires soon, so send it right away. |
curl -X POST "https://api.repliz.com/public/account/instagram/connect/680affa5ce12f2f72916f67e" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{
"code": "AUTH_CODE_FROM_REDIRECT"
}'import axios from 'axios';
const accountId = '680affa5ce12f2f72916f67e';
const response = await axios.post(
`https://api.repliz.com/public/account/instagram/connect/${accountId}`,
{
code: 'AUTH_CODE_FROM_REDIRECT',
},
{
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY',
},
},
);
console.log(response.data);const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const accountId = '680affa5ce12f2f72916f67e';
const response = await fetch(
`https://api.repliz.com/public/account/instagram/connect/${accountId}`,
{
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);// No content returned on success{
"code": 400,
"message": "incorrect generatedId to reconnect"
}{
"code": 404,
"message": "account not found"
}{
"code": 401,
"message": "unauthorized"
}