Common Uses

These are the common uses of the Pages About Story API.

Creating a Page About Story

Nodes

Permissions

Examples

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

Sample Request

curl -i -X POST \
  "https://graph.facebook.com/{your-page-id}/page_about_story
    ?title=My Title 
    &composed_text=[{"text":"My Story text.", "type":"UNSTYLED", "depth":0}]
    &is_published=true
    &access_token={your-page-access-token}"
GraphRequest request = GraphRequest.newPostRequest(
  accessToken,
  "/{your-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:@"/{your-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(
  '/{your-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(
    '/{your-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();

Sample Response

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

Creating a Page About 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.

Sample Request

curl -i -X POST \
 "https://graph.facebook.com/{your-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={your-page-access-token}"
GraphRequest request = GraphRequest.newPostRequest(
  accessToken,
  "/{your-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:@"/{your-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(
  '/{your-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(
    '/{your-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();

Sample Response

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

Getting a Page About Story

Nodes

Permissions

Examples

Send a GET /id request where id is the Page ID of the Page you you want to get information about.

Sample Request

curl -i -X GET \
 "https://graph.facebook.com/{your-page-id}
        ?fields=page_about_story
        &access_token={your-page-access-token}"
GraphRequest request = GraphRequest.newGraphPathRequest(
  accessToken,
  "/{your-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:@"/{your-page-id}"
           parameters:@{ @"fields": @"page_about_story",}
           HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];
FB.api(
  '/{your-page-id}',
  'GET',
  {"fields":"page_about_story"},
  function(response) {
      // Insert your code here
  }
);
try {
  // Returns a `FacebookFacebookResponse` object
  $response = $fb->get(
    '/{your-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();

Sample Response

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

Updating a Page About Story

Nodes

Permissions

Examples

Send a POST /id request where id is the Page Story ID you are updating and include all parameters you are updating.

Sample Request

curl -i -X POST \
 "https://graph.facebook.com/{your-page-story-id}
   ?composed_text=[{"text": "My longer story text."}]
   &access_token={your-page-access-token}"
GraphRequest request = GraphRequest.newPostRequest(
  accessToken,
  "/{your-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:@"/{your-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(
  '/{your-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(
    '/{your-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();

Sample Response

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

Deleting a Page About Story

Nodes

Permissions

Examples

Send a DELETE /id request where id is the Page Story ID you want to delete.

Sample Request

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

GraphRequest request = new GraphRequest(
  accessToken,
  "/{your-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:@"/{your-page-story-id}"
           parameters:nil
           HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];
FB.api(
  '/{your-page-story-id}',
  'DELETE',
  {},
  function(response) {
      // Insert your code here
  }
);
try {
  // Returns a `FacebookFacebookResponse` object
  $response = $fb->delete(
    '/{your-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();

Sample Response

{
  "success": true
}