Common Uses

Guides to help you perform common actions with the Page About Story API.

Before You Start

For users who own or manage the Page being queried, you will need:

  • the manage_pages permission
  • a Page access token requested by a User who can perform the MANAGE task on the Page that is being queried

For users who do not own or manage the Page being queried, you will need:

Create a Story

Only Users who own or manage the Page can create a Page About Story.

Send a POST request to the /{page-id}/page_about_story endpoint, where {page-id} is the ID of the Page, and include parameters to set the title, the story text, and to publish the story:

curl -i -X POST \
  "https://graph.facebook.com/{page-id}/page_about_story
    ?title=My Title 
    &composed_text=[{"text":"My Story text.", "type":"UNSTYLED", "depth":0}]
    &is_published=true
    &access_token={page-access-token}"
GraphRequest request = GraphRequest.newPostRequest(
  accessToken,
  "/{page-id}/page_about_story",
  new JSONObject("{\"title\":\"My Story Title\",\"composed_text\":\"[{\"text\":\"My Story text.\", \"type\":\"UNSTYLED\", \"depth\":0}]\",\"is_published\":\"true\"}"),
  new GraphRequest.Callback() {
    @Override
    public void onCompleted(GraphResponse response) {
      // Insert your code here
    }
});
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
    initWithGraphPath:@"/{page-id}/page_about_story"
           parameters:@{ @"title": @"My Story Title",@"composed_text": @"[{"text":"My Story text.", "type":"UNSTYLED", "depth":0}]",@"is_published": @"true",}
           HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];
FB.api(
  '/{page-id}/page_about_story',
  'POST',
  {"title":"My Story Title","composed_text":"[{\"text\":\"My Story text.\", \"type\":\"UNSTYLED\", \"depth\":0}]","is_published":"true"},
  function(response) {
      // Insert your code here
  }
);
try {
  // Returns a `FacebookFacebookResponse` object
  $response = $fb->post(
    '/{page-id}/page_about_story',
    array (
      'title' => 'My Story Title',
      'composed_text' => '[{"text":"My Story text.", "type":"UNSTYLED", "depth":0}]',
      'is_published' => 'true'
    ),
    '{access-token}'
  );
} catch(FacebookExceptionsFacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();

On success, your app gets this response:

{
  "page_about_story_id": "{page-story-id}"
}

Create a Story with Inline Style Elements

Send a POST /id/page_about_story request, where id is the Page ID, and include parameters to set the title, the story text with style elements, and to publish the story.

curl -i -X POST \
 "https://graph.facebook.com/{page-id}/page_about_story
   ?title=My Story Title
   &composed_text=[        
     {
       "text":"My Facebook Story text.", 
       "type":"UNSTYLED", "depth": 0, 
       "inline_style_ranges": [
         {
           "offset": 12, 
            "length": 5, 
            "style": "ITALIC"
         }
       ]
     }
   ]
   &is_published=true
   &access_token={page-access-token}"
GraphRequest request = GraphRequest.newPostRequest(
  accessToken,
  "/{page-id}/page_about_story",
  new JSONObject("{\"title\":\"My Story Title\",\"composed_text\":\"[{\"text\":\"My Facebook Story text.\", \"type\":\"UNSTYLED\", \"depth\": 0, \"inline_style_ranges\": [{\"offset\": 12, \"length\": 5, \"style\": \"ITALIC\"}]}]\",\"is_published\":\"true\"}"),
  new GraphRequest.Callback() {
    @Override
    public void onCompleted(GraphResponse response) {
      // Insert your code here
    }
});
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
    initWithGraphPath:@"/{page-id}/page_about_story"
           parameters:@{ @"title": @"My Story Title",@"composed_text": @"[{"text":"My Facebook Story text.", "type":"UNSTYLED", "depth": 0, "inline_style_ranges": [{"offset": 12, "length": 5, "style": "ITALIC"}]}]",@"is_published": @"true",}
           HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];
FB.api(
  '/{page-id}/page_about_story',
  'POST',
  {"title":"My Story Title","composed_text":"[{\"text\":\"My Facebook Story text.\", \"type\":\"UNSTYLED\", \"depth\": 0, \"inline_style_ranges\": [{\"offset\": 12, \"length\": 5, \"style\": \"ITALIC\"}]}]","is_published":"true"},
  function(response) {
      // Insert your code here
  }
);
try {
  // Returns a `FacebookFacebookResponse` object
  $response = $fb->post(
    '/{page-id}/page_about_story',
    array (
      'title' => 'My Story Title',
      'composed_text' => '[{"text":"My Facebook Story text.", "type":"UNSTYLED", "depth": 0, "inline_style_ranges": [{"offset": 12, "length": 5, "style": "ITALIC"}]}]',
      'is_published' => 'true'
    ),
    '{access-token}'
  );
} catch(FacebookExceptionsFacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();

On success, your app gets this response:

{
  "page_about_story_id": "{page-story-id}"
}

Get a Story

Send a GET request to the /{page-id} request where {page-id} is the ID of the Page you want to get information about:

curl -i -X GET \
 "https://graph.facebook.com/{page-id}
        ?fields=page_about_story
        &access_token={access-token}"
GraphRequest request = GraphRequest.newGraphPathRequest(
  accessToken,
  "/{page-id}",
  new GraphRequest.Callback() {
    @Override
    public void onCompleted(GraphResponse response) {
      // Insert your code here
    }
});

Bundle parameters = new Bundle();
parameters.putString("fields", "page_about_story");
request.setParameters(parameters);
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
    initWithGraphPath:@"/{page-id}"
           parameters:@{ @"fields": @"page_about_story",}
           HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];
FB.api(
  '/{page-id}',
  'GET',
  {"fields":"page_about_story"},
  function(response) {
      // Insert your code here
  }
);
try {
  // Returns a `FacebookFacebookResponse` object
  $response = $fb->get(
    '/{page-id}',
    '{access-token}'
  );
} catch(FacebookExceptionsFacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();

On success, your app gets this response:

{
  "page_about_story": {
    "id": "{page-about-story-id}",
    "page_id": "{page-id}",
    "is_published": true,
    "title": "My Story Title",
    "composed_text": [
      {
        "text": "My Story text.",
        "type": "UNSTYLED",
        "depth": 0
      }
    ]
  },
  "id": "{page-id}"
}

Update a Story

Only Users who own or manage the Page can create a Page About Story.

Send a POST request to the /{page-story-id} endpoint where {page-story-id} is ID of the Page Story you are updating and include all parameters you are updating:

curl -i -X POST \
 "https://graph.facebook.com/{page-story-id}
   ?composed_text=[{"text": "My longer story text."}]
   &access_token={page-access-token}"
GraphRequest request = GraphRequest.newPostRequest(
  accessToken,
  "/{page-story-id}",
  new JSONObject("{\"composed_text\":\"[{\\\"text\\\": \\\"My longer story text.\\\"}]\"}"),
  new GraphRequest.Callback() {
    @Override
    public void onCompleted(GraphResponse response) {
      // Insert your code here
    }
});
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
    initWithGraphPath:@"/{page-story-id}"
           parameters:@{ @"composed_text": @"[{"text": "My longer story text."}]",}
           HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];
FB.api(
  '/{page-story-id}',
  'POST',
  {"composed_text":"[{\"text\": \"My longer story text.\"}]"},
  function(response) {
      // Insert your code here
  }
);
try {
  // Returns a `FacebookFacebookResponse` object
  $response = $fb->post(
    '/{page-story-id}',
    array (
      'composed_text' => '[{"text": "My longer story text."}]'
    ),
    '{access-token}'
  );
} catch(FacebookExceptionsFacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();

On success, your app gets this response:

{
  "id": "{page-story-id}"
}

Delete a Story

Only Users who own or manage the Page can create a Page About Story.

Send a DELETE request to the /{page-story-id} endpoint where {page-story-id} is the ID of the Page Story you want to delete:

curl -i -X DELETE \
 "https://graph.facebook.com/{page-story-id}
   ?access_token={page-access-token}"
Bundle parameters = new Bundle();

GraphRequest request = new GraphRequest(
  accessToken,
  "/{page-story-id}",
  parameters,
  HttpMethod.DELETE,
  new GraphRequest.Callback() {
    @Override
    public void onCompleted(GraphResponse response) {
      // Insert your code here
    }
});

request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
    initWithGraphPath:@"/{page-story-id}"
           parameters:nil
           HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];
FB.api(
  '/{page-story-id}',
  'DELETE',
  {},
  function(response) {
      // Insert your code here
  }
);
try {
  // Returns a `FacebookFacebookResponse` object
  $response = $fb->delete(
    '/{page-story-id}',
    array (),
    '{access-token}'
  );
} catch(FacebookExceptionsFacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();

On success, your app gets this response:

{
  "success": true
}