English
English
Appearance
English
English
Appearance
https://api.repliz.com/public/addon/instagram/profileGets the profile of an Instagram user who has messaged a connected Instagram account, including whether they follow the account. Use it to check that someone follows before replying, for example to send a link only to followers. Pass the senderId of the chat from Get Chat or the chat webhook event.
Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Replizaddon:read (or addon:write)| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | ID of a connected Instagram account, the _id from Get Account. |
senderId | string | Yes | Instagram-scoped ID of the user, the senderId from Get Chat, for example 6793729447315239. A username is not accepted. |
curl -X GET "https://api.repliz.com/public/addon/instagram/profile?accountId=680affa5ce12f2f72916f67e&senderId=6793729447315239" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)"import axios from "axios";
const response = await axios.get("https://api.repliz.com/public/addon/instagram/profile", {
params: {
accountId: "680affa5ce12f2f72916f67e",
senderId: "6793729447315239",
},
auth: {
username: "YOUR_ACCESS_KEY",
password: "YOUR_SECRET_KEY",
},
});
console.log(response.data);const credentials = btoa("YOUR_ACCESS_KEY:YOUR_SECRET_KEY");
const response = await fetch("https://api.repliz.com/public/addon/instagram/profile?accountId=680affa5ce12f2f72916f67e&senderId=6793729447315239", {
headers: {
Authorization: `Basic ${credentials}`,
},
});
const data = await response.json();
console.log(data);{
"id": "6793729447315239",
"name": "Repliz",
"username": "repliz.id",
"picture": "https://scontent.cdninstagram.com/v/t51.2885-19/123456789_n.jpg",
"followerCount": 1200,
"isFollower": true,
"isFollowing": false
}{
"code": 400,
"message": "invalid account type"
}{
"code": 404,
"message": "account not found"
}{
"code": 401,
"message": "unauthorized"
}| Field | Description |
|---|---|
id | Instagram-scoped ID of the user, the senderId you sent. |
name | Name on the user's profile. Empty when they have none. |
username | Instagram username, without @. |
picture | URL of the profile picture. Empty when there is none. |
followerCount | Number of followers of the user. |
isFollower | true when the user follows the account. |
isFollowing | true when the account follows the user. |
Instagram only returns the profile of a user who has sent a message to the account, so a senderId from a chat always works. Anyone else, or an ID that doesn't exist, fails with the status and message from Instagram, never with an empty profile. Every call reads Instagram directly, so isFollower is the follow status at that moment. 400 with invalid account type means accountId is not an Instagram account.