Post Lifecycle

Create a Post

Create a new Post object. Mentions and hashtags will be parsed out of the post text, as will bare URLs.

You can also create a Post by sending JSON in the HTTP post body that matches the post schema with an HTTP header of Content-Type: application/json. Currently, the only keys we use from your JSON will be text, reply_to, machine_only, annotations and entities. To create complex posts (including machine only posts), you must use the JSON interface. See the JSON example below. If you would like to specify your own entities, please refer to the user specified entities documentation.

If you want to test how your text will be processed you can use the text processor.

You cannot reply to a repost. Please reply to the parent Post.

This endpoint responds to general Post parameters.

Endpoint

Method URL Token Scope
POST https://api.app.net/posts User write_post

POST Body Data

Name Description
text The raw text of the post.
reply_to (Optional) The id of the Post that this new Post is replying to.

Example

to see more complete examples.

curl -X POST -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
    -H "Content-Type: application/x-www-form-urlencoded" -d "text=If you're in San Francisco on Saturday October 20 and Sunday October 21 come to the first #adnhack => http://appnet.eventbrite.com/" \
    "https://api.app.net/posts"
{
  "data": {
    "canonical_url": "https://alpha.app.net/adn/post/914440",
    "created_at": "2012-10-11T19:48:40Z",
    "entities": {
      "hashtags": [
        {
          "len": 8,
          "name": "adnhack",
          "pos": 90
        }
      ],
      "links": [
        {
          "len": 29,
          "pos": 100,
          "text": "http://appnet.eventbrite.com/",
          "url": "http://appnet.eventbrite.com/"
        }
      ],
      "mentions": [

      ]
    },
    "html": "<span itemscope=\"https://app.net/schemas/Post\">If you're in San Francisco on Saturday October 20 and Sunday October 21 come to the first <span data-hashtag-name=\"adnhack\" itemprop=\"hashtag\">#adnhack</span> => <a href=\"http://appnet.eventbrite.com/\">http://appnet.eventbrite.com/</a></span>",
    "id": "914440",
    "machine_only": false,
    "num_replies": 1,
    "num_reposts": 3,
    "num_stars": 3,
    "source": {
      "client_id": "caYWDBvjwt2e9HWMm6qyKS6KcATHUkzQ",
      "link": "https://alpha.app.net",
      "name": "Alpha"
    },
    "text": "If you're in San Francisco on Saturday October 20 and Sunday October 21 come to the first #adnhack => http://appnet.eventbrite.com/",
    "thread_id": "914440",
    "user": "...user object...",
    "you_reposted": false,
    "you_starred": false
  },
  "meta": {
    "code": 200
  }
}

Example (JSON Data)

to see more complete examples.

curl -X POST -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
    -H "Content-Type: application/json" -d "{
  \"text\": \"If you're in San Francisco on Saturday October 20 and Sunday October 21 come to the first #adnhack => http://appnet.eventbrite.com/\",
  \"annotations\": [
    {
      \"type\": \"net.app.core.geolocation\",
      \"value\": {
        \"latitude\": 74.0064,
        \"longitude\": 40.7142
      }
    }
  ]
}" \
    "https://api.app.net/posts?include_post_annoations=1"
{
  "data": {
    "canonical_url": "https://alpha.app.net/adn/post/914440",
    "created_at": "2012-10-11T19:48:40Z",
    "entities": {
      "hashtags": [
        {
          "len": 8,
          "name": "adnhack",
          "pos": 90
        }
      ],
      "links": [
        {
          "len": 29,
          "pos": 100,
          "text": "http://appnet.eventbrite.com/",
          "url": "http://appnet.eventbrite.com/"
        }
      ],
      "mentions": [

      ]
    },
    "html": "<span itemscope=\"https://app.net/schemas/Post\">If you're in San Francisco on Saturday October 20 and Sunday October 21 come to the first <span data-hashtag-name=\"adnhack\" itemprop=\"hashtag\">#adnhack</span> => <a href=\"http://appnet.eventbrite.com/\">http://appnet.eventbrite.com/</a></span>",
    "id": "914440",
    "machine_only": false,
    "num_replies": 1,
    "num_reposts": 3,
    "num_stars": 3,
    "source": {
      "client_id": "caYWDBvjwt2e9HWMm6qyKS6KcATHUkzQ",
      "link": "https://alpha.app.net",
      "name": "Alpha"
    },
    "text": "If you're in San Francisco on Saturday October 20 and Sunday October 21 come to the first #adnhack => http://appnet.eventbrite.com/",
    "thread_id": "914440",
    "user": "...user object...",
    "you_reposted": false,
    "you_starred": false,
    "annotations": [
      {
        "type": "net.app.core.geolocation",
        "value": {
          "latitude": 74.0064,
          "longitude": 40.7142
        }
      }
    ]
  },
  "meta": {
    "code": 200
  }
}

Delete a Post

Delete a Post. The current user must be the same user who created the Post. It returns the deleted Post on success.

This endpoint responds to general Post parameters.

Remember, access tokens can not be passed in a HTTP body for DELETE requests. Please refer to the authentication documentation.

Endpoint

Method URL Token Scope
DELETE https://api.app.net/posts/{post_id} User write_post

URL Parameters

Name Description
post_id The id of the Post to delete.

Example

to see more complete examples.

curl -X DELETE -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
    "https://api.app.net/posts/914440"
{
  "data": {
    "canonical_url": "https://alpha.app.net/adn/post/914440",
    "created_at": "2012-10-11T19:48:40Z",
    "entities": {
      "hashtags": [

      ],
      "links": [

      ],
      "mentions": [

      ]
    },
    "id": "914440",
    "machine_only": false,
    "num_replies": 1,
    "num_reposts": 3,
    "num_stars": 3,
    "source": {
      "client_id": "caYWDBvjwt2e9HWMm6qyKS6KcATHUkzQ",
      "link": "https://alpha.app.net",
      "name": "Alpha"
    },
    "thread_id": "914440",
    "user": "...user object...",
    "you_reposted": false,
    "you_starred": false,
    "is_deleted": true
  },
  "meta": {
    "code": 200
  }
}