PageCanvasElements
GET /v22.0/{page-id}/canvas_elements HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{page-id}/canvas_elements',
'{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 */
/* make the API call */
FB.api(
"/{page-id}/canvas_elements",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}/canvas_elements",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}/canvas_elements"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
由此關係連線進行的閱讀將回傳 JSON 格式結果:
{ "
data
": [], "paging
": {} }
data
paging
錯誤 | 說明 |
---|---|
100 | Invalid parameter |
canvas_elements
edge from the following paths: 參數 | 說明 |
---|---|
canvas_button Object | Create a canvas button that belongs to a page |
canvas_carousel Object | Create a canvas carousel that belongs to a page |
canvas_footer Object | Create a canvas footer that belongs to a page |
canvas_header Object | Create a canvas header that belongs to a page |
canvas_lead_form Object | The id of corresponding published lead form |
canvas_photo Object | Create a canvas photo that belongs to a page |
canvas_product_list Object | Creat a canvas product list that belongs to a page |
canvas_product_set Object | Creat a canvas product set that belongs to a page |
canvas_store_locator Object | Create a canvas store locator that belongs to a page |
canvas_template_video Object | Create a template video that belongs to a page |
canvas_text Object | Create a canvas text that belongs to a page |
canvas_video Object | Create a canvas video that belongs to a page |
id
的節點。id
: numeric string, 錯誤 | 說明 |
---|---|
100 | Invalid parameter |
368 | The action attempted has been deemed abusive or is otherwise disallowed |
200 | Permissions error |
283 | That action requires the extended permission pages_read_engagement and/or pages_read_user_content and/or pages_manage_ads and/or pages_manage_metadata |
190 | Invalid OAuth 2.0 Access Token |
210 | User not visible |
104 | Incorrect signature |
80001 | There have been too many calls to this Page account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting. |