XP-Dev.com Documentation

Blogs API

This user guide only applies if your account and project is on our new platform, i.e. if your project's URL begins with https://<your-account>.xp-dev.com rather than https://xp-dev.com. If your account is on our old platform, you should be using this user guide instead.

Each Blog Object has the following attributes:

Attribute Description
id Unique Blog ID
title Blog title
text Blog text in Textile
htmlText Blog text in HTML
published Whether the Blog is published or not

List All Blogs

GET request to https://<your-account>.xp-dev.com/api/v1/blogs/project/<project-id>:

curl https://<your-account>.xp-dev.com/api/v1/blogs/project/3

Responses will be a list of Blogs Objects:

[
    {
        "id":3,
        "project": {
          "id": 3
        },
        "published":false,
        "text":"First blog entry",
        "title":"First entry",
        "htmlText":"<p>First blog entry</p>"
    },
    ...
]

Create a New Blog

POST request to https://<your-account>.xp-dev.com/api/v1/blogs with the following attributes:

Mandatory:

  • project
  • title
  • text
  • published

Example request:

curl -X POST -H 'Content-Type: application/json' -d '{"project":{"id":3},"published":false,"text":"This is the first blog entry","title":"First entry"}' https://<your-account>.xp-dev.com/api/v1/blogs

Responses will be in the form of a single Blog Object

Get a Single Blog

GET request to https://<your-account>.xp-dev.com/api/v1/blogs/<blog-id>. For example:

curl https://<your-account>.xp-dev.com/api/v1/blogs/6

Responses will be in the form of a single Blog Object

Update a Single Blog

PUT request to https://<your-account>.xp-dev.com/api/v1/blogs/<blog-id> with the following attributes:

Mandatory:

  • title
  • text
  • published

Example request:

curl -X PUT -H 'Content-Type: application/json' -d '{"published":true,"text":"This is the first blog entry","title":"First entry"}' https://<your-account>.xp-dev.com/api/v1/blogs/6

Responses will be in the form of a single Blog Object

Delete a Single Blog

DELETE request to https://<your-account>.xp-dev.com/api/v1/blogs/<blog-id>:

curl -X DELETE https://<your-account>.xp-dev.com/api/v1/blogs/6

Feel free to contact us if you need any assistance.