当我使用Javascript SDK向通知资源发出POST时,我会得到一个id。
<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>
然后,当我向trip/5/messages发出GET请求时,它不会出现。
<script type="text/javascript">
ATT.Request(
"trip/13427/messages",
"get",
replaceWithYourOwnCallback,
{"access_token" : "197d39aeb300c0a4b5e0b6a4d9624d0a"},
postparams = null
);
</script>
我做错了什么?
发布于 2011-10-13 06:28:46
为了将消息链接到您的行程,您必须在related_object_type和related_object_id中包含该行程:
https://addtotrip.co/home/Resource?resource=notification
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"
}
https://stackoverflow.com/questions/7747005
复制相似问题