Javascript ATT API通知资源
当我使用Javascript SDK向通知资源发布帖子时,我得到了一个idJavascript ATT API通知资源,javascript,Javascript,当我使用Javascript SDK向通知资源发布帖子时,我得到了一个id <script type="text/javascript"> ATT.Request( "notification", "post", function(){ //do stuff here }, {"access_token" : my_access_token_here}, { "interfaces": [ {
<script type="text/javascript">
ATT.Request(
"notification",
"post",
function(){ //do stuff here },
{"access_token" : my_access_token_here},
{
"interfaces": [
{
"interface_id": 1
},
{
"interface_id": 2
},
{
"interface_id": 3
},
{
"interface_id": 4
}
],
"custom_body": "This is a wonderful trip!",
"target_response_info_type": "activity",
"message_type": "22",
"interfaces_custom_body": [
{
"interface_id": 1,
"custom_subject": "none",
"custom_body": "This is a wonderful trip!"
},
{
"interface_id": 2,
"custom_subject": "none",
"custom_body": "This is a wonderful trip!"
},
{
"interface_id": 3,
"custom_subject": "none",
"custom_body": "This is a wonderful trip!"
},
{
"interface_id": 4,
"custom_subject": "none",
"custom_body": "This is a wonderful trip!"
}
],
"do_not_send": "0"
}
);
</script>
附件请求(
“通知”,
“职位”,
函数(){//do stuff here},
{“访问令牌”:我的访问令牌在这里},
{
“接口”:[
{
“接口id”:1
},
{
“接口id”:2
},
{
“接口id”:3
},
{
“接口id”:4
}
],
“定制身体”:“这是一次美妙的旅行!”,
“目标\响应\信息\类型”:“活动”,
“消息类型”:“22”,
“接口\自定义\正文”:[
{
“接口id”:1,
“自定义主题”:“无”,
“定制身体”:“这是一次美妙的旅行!”
},
{
“接口id”:2,
“自定义主题”:“无”,
“定制身体”:“这是一次美妙的旅行!”
},
{
“接口id”:3,
“自定义主题”:“无”,
“定制身体”:“这是一次美妙的旅行!”
},
{
“接口id”:4,
“自定义主题”:“无”,
“定制身体”:“这是一次美妙的旅行!”
}
],
“不发送”:“0”
}
);
然后,当我向trip/5/消息发出GET请求时,它不会显示
<script type="text/javascript">
ATT.Request(
"trip/13427/messages",
"get",
replaceWithYourOwnCallback,
{"access_token" : "197d39aeb300c0a4b5e0b6a4d9624d0a"},
postparams = null
);
</script>
附件请求(
“trip/13427/messages”,
“得到”,
替换为您自己的回调,
{“访问令牌”:“197d39aeb300c0a4b5e0b6a4d9624d0a”},
postparams=null
);
我做错了什么 为了将消息链接到您的行程,您必须将该行程包含在相关的\u对象\u类型和相关的\u对象\u id中: post数据应如下所示:
{"access_token" : my_access_token_here},
{
"related_object_type": "trip",
"related_object_id": "13427",
"interfaces": [
{
"interface_id": 1
},
{
"interface_id": 2
},
{
"interface_id": 3
},
{
"interface_id": 4
}
],
"custom_body": "This is a wonderful trip!",
"target_response_info_type": "activity",
"message_type": "22",
"interfaces_custom_body": [
{
"interface_id": 1,
"custom_subject": "none",
"custom_body": "This is a wonderful trip!"
},
{
"interface_id": 2,
"custom_subject": "none",
"custom_body": "This is a wonderful trip!"
},
{
"interface_id": 3,
"custom_subject": "none",
"custom_body": "This is a wonderful trip!"
},
{
"interface_id": 4,
"custom_subject": "none",
"custom_body": "This is a wonderful trip!"
}
],
"do_not_send": "0"
}