/* make the API call */
FB.api(
"/me/video.rates",
"POST",
{
"rating:value": 3.1415926535,
"rating:scale": 42,
"episode": "http:\/\/samples.ogp.me\/335419676534648",
"movie": "http:\/\/samples.ogp.me\/453907197960619",
"tv_show": "http:\/\/samples.ogp.me\/413802348663468",
"other": "http:\/\/samples.ogp.me\/467235199955838"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
@"rating:value": @3.1415926535,
@"rating:scale": @42,
@"episode": @"http://samples.ogp.me/335419676534648",
@"movie": @"http://samples.ogp.me/453907197960619",
@"tv_show": @"http://samples.ogp.me/413802348663468",
@"other": @"http://samples.ogp.me/467235199955838",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/me/video.rates"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Bundle params = new Bundle();
params.putDouble("rating:value", 3.1415926535);
params.putInt("rating:scale", 42);
params.putString("episode", "http://samples.ogp.me/335419676534648");
params.putString("movie", "http://samples.ogp.me/453907197960619");
params.putString("tv_show", "http://samples.ogp.me/413802348663468");
params.putString("other", "http://samples.ogp.me/467235199955838");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/me/video.rates",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/me/video.rates',
array (
'rating:value' => 3.1415926535,
'rating:scale' => 42,
'episode' => 'http://samples.ogp.me/335419676534648',
'movie' => 'http://samples.ogp.me/453907197960619',
'tv_show' => 'http://samples.ogp.me/413802348663468',
'other' => 'http://samples.ogp.me/467235199955838',
),
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
POST /v3.2/me/video.rates HTTP/1.1
Host: graph.facebook.com
rating%3Avalue=3.1415926535&rating%3Ascale=42&episode=http%3A%2F%2Fsamples.ogp.me%2F335419676534648&movie=http%3A%2F%2Fsamples.ogp.me%2F453907197960619&tv_show=http%3A%2F%2Fsamples.ogp.me%2F413802348663468&other=http%3A%2F%2Fsamples.ogp.me%2F467235199955838
curl -X POST \
-d "rating%3Avalue=3.1415926535" \
-d "rating%3Ascale=42" \
-d "episode=http%3A%2F%2Fsamples.ogp.me%2F335419676534648" \
-d "movie=http%3A%2F%2Fsamples.ogp.me%2F453907197960619" \
-d "tv_show=http%3A%2F%2Fsamples.ogp.me%2F413802348663468" \
-d "other=http%3A%2F%2Fsamples.ogp.me%2F467235199955838" \
https://graph.facebook.com/v3.2/me/video.rates
Request