POST api/v3/instagram_accounts
Create User Instagram Accounts

Request headers

Only registered user can perform this action
  Authentication - string - required
    Example of Authentication header : "Bearer TOKEN_FETCHED_FROM_SERVER_DURING_REGISTRATION"

Request body example

{
  "facebook_account": {
    "fb_token": "FB_TOKEN",
    "rb_uid": "FB_UID",
    "location": templateBranding
  },
  "ig_accounts": [
    {
      "id": "IG_ACCOUNT_UID",
      "username": "Ov_dev_sl_2",
      "fb_token": "ACCESS_TOKEN",
      "profile_picture_url": "https://scontent-iad3-1.xx.fbcdn.net/v/t39.30808-1/344871424_1571948339950824_3238105955092709413_n.png?stp=cp0_dst-png_p50x50&_nc_cat=111&ccb=1-7&_nc_sid=dbb9e7&_nc_ohc=nbK0WSHJcMkAX8hTPGc&_nc_ht=scontent-iad3-1.xx&edm=AGaHXAAEAAAA&oh=00_AfAYv8ssm2oogVS5zx2wxwFEwMQcYfDotdUQNct5apnzpg&oe=6457D34B"
    },
    ...
  ]
}

Success response body

{
  "success": false,
  "ig_accounts": [],
  "message": [
    "Instagram account IG_NAME not connected. To connect this social media account to your Personal, you must first remove it from your Workspace accounts"
  ]
}
  OR
{
  "success": true,
  "ig_accounts": [
    {
      "id": 7586,
      "ig_user_id": "17841405902213202",
      "ig_user_name": "twentyonekate",
      "ig_profile_picture_url": null,
      "facebook_page_id": null,
      "user_id": null,
      "created_at": "2024-06-21T06:41:04.966Z",
      "updated_at": "2024-06-21T06:41:04.966Z",
      "nickname": "",
      "connected_teams": null,
      "fb_token": "EAAhDAggZCCzwBO1KQ32VPo0ZCXbTNlRNLnXF9d6BsTVkGhTRyRNYTLHF2kgM8HeKdcisZB1B8s1QbGHMNysr7VBLnYUvzcMt85QY7Lt4IUGEZBYnEJBg5AnmF7IxLMeBUZCjcTy6CJZBPUhDsblu9r8PYvLtDwXpdy3WiXSlvBBkUklItgM3kbjzBw0TIVfToL0cGMHtBBkNm8k1JbDdBpH0QZD",
      "facebook_account_id": 10528
    }
  ],
  "message": []
}

Error response body

# for admins
{
  "ig_user_id": ["To connect this social media account to your Personal, you must first remove it from your Workspace accounts"]
}
# for creators
{
  "ig_user_id": ["This social account is already connected to your Workspace! Please ask example@mail.com for access"]
}

Errors

Code Description
422 Could not save the entity.

Params

Param name Description
facebook_account
required

Validations:

  • Must be a Hash

facebook_account[fb_token]
required

Validations:

  • Must be a String

facebook_account[fb_uid]
required

Validations:

  • Must be a String

facebook_account[location]
optional

Validations:

  • Must be one of: workspaceSettingsPage, signUpForm, guidedWalkthrough, progressMeter, personalSettingsPage, templateBranding.

ig_accounts
optional

Validations:

  • Must be an Array of nested elements

ig_accounts[id]
required

Validations:

  • Must be a String

ig_accounts[username]
required

Validations:

  • Must be a String

ig_accounts[profile_picture_url]
required

Validations:

  • Must be a String

ig_accounts[fb_token]
required

Validations:

  • Must be a String


DELETE /api/v3/instagram_accounts/:id
Delete User Instagram Account

Request headers

Only registered user can perform this action
  Authentication - string - required
    Example of Authentication header : "Bearer TOKEN_FETCHED_FROM_SERVER_DURING_REGISTRATION"

Success response body

{
  "success": true,
  "instagram_account_id": 1
}

Params

Param name Description
id
required

ID of Instagram Account

Validations:

  • Must be a Integer