เวอร์ชันของ API กราฟ

Canvas Photo

การอ่าน

A photo inside a canvas

Example

use FacebookAds\Api;
use FacebookAds\Http\RequestInterface;

$params = array(
  'fields' => array(
    'action',
    'id',
    'name',
    'photo',
  ),
);

$data = Api::instance()->call(
  '/' . <CANVAS_PHOTO_ID>,
  RequestInterface::METHOD_GET,
  $params)->getContent();
curl -G \
  --data-urlencode 'fields=[ 
    "action", 
    "id", 
    "name", 
    "photo" 
  ]' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/<CANVAS_PHOTO_ID>

พารามิเตอร์

จุดสิ้นสุดนี้ไม่ต้องพารามิเตอร์ใดๆ

ช่อง

ช่องคำอธิบาย
id
numeric string

The id of the element

action
CanvasOpenURLAction

The action associated with the photo

bottom_padding
numeric string

The padding below the element

deep_link
string

Deep link destination only for mobile apps (used for mobile install or engagement ads, and app link is supported)

element_group_key
string

The element group key to bundle multiple elements in editing

element_type
enum

The type of the element

hide_product_prices
bool

Flag to determine whether or not to hide prices for tagged products

name
string

The name of the element

photo

The facebook photo node

product_tags
list<CanvasProductTag>

The product tags on the photo

style
enum

The presentation style of the photo node

top_padding
numeric string

The padding above the element

Error Codes

ข้อผิดพลาดคำอธิบาย
368The action attempted has been deemed abusive or is otherwise disallowed
80001There 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.

การสร้าง

คุณไม่สามารถดำเนินการนี้ที่ปลายทางนี้

กำลังอัพเดต

คุณไม่สามารถดำเนินการนี้ที่ปลายทางนี้

กำลังลบ

คุณไม่สามารถดำเนินการนี้ที่ปลายทางนี้

Add Product Tags

Create an ads experience that mimics browsing a printed, lifestyle catalog featuring desired products to promote. You can tag featured products in the image and a tag appears on the image.

This API is available on a limited basis to partners and advertisers that are on the allow list. Contact your Facebook representative if you want to use this API.

When someone taps the tag, a thumbnail for that product appears in a rotating group of thumbnails, including all tagged products. Someone can tap the thumbnail to be taken to the product's product detail page. This uses the photo with product tags element API. For example:

curl -F 'canvas_photo={ "bottom_padding": 20, "name": "Instant Experience Photo Name", "open_url_action": {"url":"URL"}, "photo_id": "PHOTO_ID", "style": "FIT_TO_WIDTH", "top_padding": 20, "product_tags": "[{product_id: PRODUCT_ID, coordinates: [0.65, 0.58]}, {product_id: PRODUCT_ID}]" }' }' -F 'access_token=ACCESS_TOKEN' https://graph.facebook.com/VERSION/PAGE_ID/canvas_elements

The options available for product tags are:

Field Name Description Type Required

product_tags

Provide a list of products for the photo

array

Yes

product_id

Product id for tapped photo

number

Yes

coordinates

Spot coordinates on the photo.

array, where x and y greater than zero and less than 1

No. If none specified, there is no spot on the photo