刷新访问口令

您可以通过此端点刷新长期Instagram 用户访问口令

私人 Instagram 帐户的长期访问口令现在可以刷新。另外,拥有私人帐户的应用用户授予应用的权限的有效期现在是是 90 天。

创建

不支持此操作。

读取

GET /refresh_access_token

刷新生成时间不少于 24 小时且并未过期的长期Instagram 用户访问口令。已刷新口令的有效期为:自刷新日起 60 天。

要求

请求语法

GET https://graph.instagram.com/refresh_access_token
  ?grant_type=ig_refresh_token
  &access_token={long-lived-access-token}

查询字符串参数

添加以下查询字符串参数以扩充请求。

grant_type
必需
字符串

将其设置为 ig_refresh_token

access_token
必需
字符串

您希望刷新的有效(未过期)的长期Instagram 用户访问口令

响应

包含下列属性和值的 JSON 格式对象。

{
  "access_token": "{access-token}",
  "token_type": "{token-type}",
  "expires_in": {expires-in}
}

响应内容

值占位符

{access-token}
数字字符串

长期 Instagram 用户访问口令。

{token-type}
字符串

bearer

{expires-in}
整数

长期口令保持有效的秒数。

cURL 示例

请求

curl -X GET \
  'https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&&access_token=F4RVB...'

响应

{
  "access_token": "c3oxd...",
  "token_type": "bearer",
  "expires_in": 5183944
}

更新

不支持此操作。

删除

不支持此操作。