I create objects through the open chart API and attach them to published stories. Both the object and the story are created, and the FB returns an id, as if everything turned out just fine.
However, when sending the object / history for viewing, it turned out that two objects were created (different types of objects), although I was making only one HTTP POST request.
Background
- Our application uses the namespace 'mynamespace'
- We created a custom graph public object named 'myobject'
- We created a custom open action called "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 object:
access_token=TOKEN&object={"url":"http://url.com","title":"My title","image":"https://imageurl.com","description":"My description"}
Answer:
"{\"id\":\"123456789\"}"
2) Then we create a story (with the specified object):
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 object:
access_token=TOKEN&myobject=123456789&fb:explicitly_shared=true&message=User generated message
Answer:
"{\"id\":\"12121212121\"}"
Expected Result
- One object of type mynamespace: myobject must be created
- One story like mynamespace: myaction must be created
Actual result
- One object of type mynamespace: myobject created
- One story like mynamespace: myaction is created
- One object of type Object is created (according to the reviewer)
- One Post type action is created (according to reviewers)
Only one story appeared in the user’s feed and in the object browser, but the reviewer told us the following: Your action displays more than one published story when the user starts the action. Users should not be surprised that several publications are published for one action in the application. The action I took produced the "post" and the story "myaction".
We looked at (Open Graph → Types), and it turned out that every time we make this request, an object of type "Object" and an action of type "Post" are automatically created / defined! This should be what the reviewer complains about, but we were not able to figure out what we are doing wrong!
Any suggestions on how this can be resolved are greatly appreciated.
Exact error when using Open API APIs
It turns out the same thing happens when you create an object through the Google Graph API. At the same time, the “Object” object and the “Mail” action unexpectedly appear in the section “Open Graph → Types”. Now I see the following causes of this problem:
- Object / action / history incorrectly configured
- The reviewer thought it was a problem when in fact it was not
- This is a FB error
Objects Created Using Graph APIs
When creating an object through the Graph API, 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" }
"post_action_id" seems weird, and when I request this object:
{ "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 an object already has an og.posts object associated with it should be considered in this review. I still don't understand why this og.posts object is automatically displayed as an open graph object.