Graph API Version

Canvas Product Set

Reading

A product set inside the canvas

Example

Graph API Explorer
GET /v2.11/{canvas-product-set-id} 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(
    '/{canvas-product-set-id}',
    '{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(
    "/{canvas-product-set-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{canvas-product-set-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{canvas-product-set-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

This endpoint doesn't have any parameters.

Fields

FieldDescription

id

numeric string

The id of the element

bottom_padding

numeric string

The padding below the element

element_group_key

string

The element group key to bundle multiple elements in editing

element_type

enum

The type of the element

item_description

string

A token to represent which field from the product to show in the product description

item_headline

string

A token to represent which field from the product to show in the product headline

max_products

unsigned int32

Maximum number of products to show

name

string

The name of the element

product_set_id

numeric string

The product set id which contains a subset of products within a product catalog

retailer_item_ids

string

An array of items that should be shown first in the product set element. If this is not set then products will be dynamically chosen

show_in_feed

bool

A flag that products should be shown in feed unit

top_padding

numeric string

The padding above the element

Edges

No edges

Validation Rules

ErrorDescription
100Invalid parameter

Creating

You can't perform this operation on this endpoint.

Updating

Example

You can update a CanvasProductSet by making a POST request to /{canvas_product_set_id}.

Parameters

NameDescription
bottom_padding
float

The padding below the product set

item_description
string

A token to represent which field from the product to show in the product description

item_headline
string

A token to represent which field from the product to show in the product headline

max_items
int64

Maximum number of products to show

name
string

Name of the product set element

product_set_id
id

The product set id which contains a subset of products within a product catalog

retailer_item_ids
list<string>

An array of items that should be shown first in the product set element. If this is not set then products will be dynamically chosen

show_in_feed
boolean
Default value: false

A flag that products should be shown in feed unit

top_padding
float

The padding above the product set

Return Type

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,
}

Deleting

Example

You can delete a CanvasProductSet by making a DELETE request to /{canvas_product_set_id}.

Parameters

This endpoint doesn't have any parameters.

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter