You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用Instagram Send message API返回400错误,寻求技术排查帮助

排查Instagram消息API返回400(错误码100/2534014)的问题

问题详情

调用Instagram发送消息API时持续返回400错误,错误提示为Cannot find the requested user.,对应错误码100,子错误码2534014。

请求示例:

curl --location 'https://graph.instagram.com/v20.0/{sender_instagram_ID}/messages' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
    "recipient": {
        "id": {recipient_instagram_ID}
    },
    "message": {
        "text": "hi,"
    }
}'

返回错误内容:

{
    "error": {
        "message": "Cannot find the requested user.",
        "type": "IGApiException",
        "code": 100,
        "error_subcode": 2534014
    }
}

已知前置信息:

  • 应用处于开发环境
  • 发送方、接收方ID均通过/me?fields=id,username接口获取
  • 已获取权限:instagram_business_basic、instagram_business_manage_messages、instagram_business_content_publish、instagram_business_manage_comments
  • 基于官方消息API文档开发

排查步骤

1. 验证接收方ID类型

消息API要求接收方必须是Instagram业务账号ID,个人账号ID无法被识别:

  • 调用/{recipient_instagram_ID}?fields=business_discovery.username({username}){id,username}接口,确认该ID是否关联业务账号
  • 检查接收方账号是否已完成Instagram业务账号转换

2. 确认开发环境测试范围

开发环境下,消息API仅允许向应用测试用户发送消息:

  • 登录Meta开发者后台,检查接收方是否已添加为应用的测试用户
  • 确认发送方账号(调用API的账号)是否为应用关联的测试账号

3. 检查账号互动权限

即使是测试用户,发送方与接收方需满足以下任一条件:

  • 接收方已关注发送方的业务账号
  • 接收方曾主动向发送方发送过消息(开启对话权限)
    开发环境下未满足上述条件,会触发「用户未找到」错误

4. 校验Access Token有效性

  • 调用/debug_token接口,验证token是否包含instagram_business_manage_messages权限,且未过期
  • 确保Access Token是通过业务账号授权流程获取的,个人账号授权的token无法调用消息API

5. 检查请求格式正确性

  • 确认请求URL中的sender_instagram_ID是发送方的业务账号ID,而非个人账号ID
  • 检查请求体中recipient.id是否为实际字符串值,避免残留{recipient_instagram_ID}这类未替换的占位符

内容的提问来源于stack exchange,提问作者Miao

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 20:05:12