English
English
Appearance
English
English
Appearance
https://api.repliz.com/public/account/instagram/unified/connect/{accountId}Finishes turning on Music & Research for the Instagram account with the code from the redirect of Authorize Instagram Music & Research. The account then has additional.isUnified: true in Get Account, and an Instagram video or reel scheduled with additionalInfo.music is published with that audio.
Call it again, after a new Authorize, to reconnect Music & Research, for example when the user removed Repliz from their business portfolio. It doesn't change the Instagram connection itself: for that, use Reconnect Instagram.
Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Replizaccount:write| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | ID of the Instagram account, the same accountId you sent to Authorize, the _id from Get Account. |
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | The code query parameter from the URL the user was sent back to, as it is. It works only once and expires soon, so send it right away. The user has to pick this Instagram account in the login. Send it from the same Repliz account that called Authorize, within 1 hour. |
curl -X POST "https://api.repliz.com/public/account/instagram/unified/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/unified/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/unified/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": "this instagram account was not picked in the meta business login"
}{
"code": 404,
"message": "account not found"
}{
"code": 401,
"message": "unauthorized"
}400 with this instagram account was not picked in the meta business login means the user logged in but didn't pick this Instagram account, or picked another one. Start again from Authorize. invalid account type means accountId isn't an Instagram account. An expired or already used code fails with the status and message from Meta.