Graph API Version

Page Nativeoffers

Reading

Edge to get native offers owned by the page.

Graph API Explorer
GET /v2.8/{page-id}/nativeoffers HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{page-id}/nativeoffers'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* 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
}];

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
  • ads_management
  • manage_pages
  • publish_pages
  • pages_show_list
Page management Apps
  • manage_pages
  • publish_pages
  • pages_show_list
Other Apps
No data

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
262Incorrect permission to publish pages

Creating

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, EAN, PDF417, QR, UPC_A, UPC_E, DATAMATRIX, CODE93}

Barcode type for in-store offers.

barcode_value
string

Barcode value for in-store offers.

details
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.

redemption_link
URL

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

terms
string

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

Return Type

Struct {
id: numeric string,
}

Validation Rules

ErrorDescription
262Incorrect permission to publish pages
100Invalid parameter
2825The given page is not eligible for Offers at this time.
2826The barcode service returned an error; please try again later, or try different type and value parameters.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.