Graph API Version

Page Nativeoffers

Reading

Edge to get native offers owned by the page.

Example

Graph API Explorer
GET /v2.11/{page-id}/nativeoffers 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}/nativeoffers',
    '{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}/nativeoffers",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/nativeoffers",
    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:@"/{page-id}/nativeoffers"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Parameters

This endpoint doesn't have any parameters.

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of NativeOffer nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
200Permissions error

Creating

Example

You can make a POST request to nativeoffers edge from the following paths:
When posting to this edge, a NativeOffer will be created.

Parameters

NameDescription
barcode_type
enum {CODE128, CODE128B, CODE93, DATABAR, DATABAR_EXPANDED, DATABAR_EXPANDED_STACKED, DATABAR_LIMITED, DATAMATRIX, EAN, PDF417, QR, UPC_A, UPC_E}

Barcode type for in-store offers.

barcode_value
string

Barcode value for in-store offers.

details
UTF-8 encoded string

Additional primary text describing the native offer.

Required
disable_location
boolean

Whether or not to disable location features, such as the map and nearby notification.

discounts
list<Object>

An array of OfferDiscount objects.

Required
type
enum {percentage_off, free_stuff, cash_discount, bogo}
Required
text
string
value1
float
value2
float
currency
ISO 4217 Currency Code
override
string
Default value:
expiration_time
datetime

The unix time representing when the offer expires.

Required
instore_code
string

The code used to redeem the native offer in-store. This code should not contain any spaces.

location_type
enum {online, offline, both}
Default value: online

A OfferAvailabilityLocation enum value.

max_save_count
int64
Default value: 0

Maximum number of allowed saves, 0 is unlimited.

online_code
string

The code used to redeem the native offer online. This code should not contain any spaces.

page_set_id
numeric string or integer

The ID of Place Page Set which represents the locations where this in-store offer is valid for.

redemption_link
URL

The URL to the site where a user can redeem the offer.

terms
UTF-8 encoded string

Limitations, terms and conditions on the use of the native offer.

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Validation Rules

ErrorDescription
200Permissions error
100Invalid parameter
262Incorrect permission to publish pages
2826The barcode service returned an error; please try again later, or try different type and value parameters.
2831This offer requires a redemption_link URL.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.