I am creating objects through the open graph object API, and attaching these to published stories. Both the object and the story are created, and FB returns id's as if everything worked out just fine.
However, while submitting the object/story for review it turned out two objects are created (of different object types) even though I only make one HTTP POST request.
Background
- Our app is using namespace 'mynamespace'
- We have created a custom open graph object with name 'myobject'
- We have created a custom open graph action with name 'myaction'
Request details:
1) First we create an object:
POST /me/objects/mynamespace:myobject HTTP/1.1\r\nConnection: close\r\nHost: graph.facebook.com\r\nContent-Length: LENGTH\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n
URI decoded http body:
access_token=TOKEN&object={"url":"http://url.com","title":"My title","image":"https://imageurl.com","description":"My description"}
Response:
"{\"id\":\"123456789\"}"
2) Then we create a story (with this object referenced):
POST /me/mynamespace:myaction HTTP/1.1\r\nConnection: close\r\nHost: graph.facebook.com\r\nContent-Length: LENGHT\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n
URI decoded http body:
access_token=TOKEN&myobject=123456789&fb:explicitly_shared=true&message=User generated message
Response:
"{\"id\":\"12121212121\"}"
Expected result
- One object of type mynamespace:myobject should be created
- One story of type mynamespace:myaction should be created
Actual result
- One object of type mynamespace:myobject is created
- One story of type mynamespace:myaction is created
- One object of type Object is created (according to reviewer)
- One action of type Post is created (according to reviewer)
Only one story turned up in the user feed and in the object browser, but the reviewer told us following: Your action produces more than one published story when the user triggers the action. Users shouldn’t be surprised by multiple stories being published for a single in-app action. The action I took produced a "post" and a "myaction" story.
We had a look under (Open Graph -> Types) and it turned out that each time we make this request an object of type 'Object' and an action of type 'Post' is automatically created/defined! This must be what the reviewer complains about, but we haven't been able to figure out what we're doing wrong!
Any suggestions on how this can be solved is be very much appreciated.
Exact same issue when using the Open Graph API explorer
Turns out the exact same thing happens when creating an object through the Facebook Graph API explorer. When doing so the 'Object' object and the 'Post' action suddenly appears under Open Graph -> Types. Right now I see following reasons to this issue:
- The object/action/story is set up incorrect in some way
- The reviewer thought it was an issue when it actually wasn't
- It's a FB bug
Object(s) created through the Graph API explorer
When creating an object through the Graph API explorer this is the resulting object:
{
"id": "4324324234234234",
"url": "http://url.com",
"type": "mynamespace:myaction",
"title": "My title",
"image": [
{
"url": "https://imageurl.com"
}
],
"description": "My description",
"updated_time": "2013-07-09T14:14:38+0000",
"created_time": "2013-07-09T14:14:38+0000",
"application": {
"id": "432423423423",
"name": "appname",
"url": "https://www.facebook.com/apps/appurl"
},
"is_scraped": false,
"post_action_id": "23423423423423423"
}
The 'post_action_id' seems weird, and when requesting that object I get:
{
"id": "423423423423",
"from": {
"name": "My name",
"id": "234234"
},
"start_time": "2013-07-09T14:14:38+0000",
"end_time": "2013-07-09T14:14:38+0000",
"publish_time": "2013-07-09T14:14:38+0000",
"application": {
"name": "appname",
"namespace": "mynamespace",
"id": "432423423423"
},
"data": {
"object": {
"id": "4324324234234234",
"url": "http://url.com",
"type": "mynamespace:myaction",
"title": "My title"
}
},
"type": "og.posts",
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true,
"comment_order": "chronological"
}
}
The fact that the object already has a related og.posts object must be what the review think is the issue here. I still don't understand why this og.posts object automatically shows up as an open graph object though.