Pages API


POST /api/v1/products/:product_id/pages

Create a page

Parameters

Name Description
product_id * Numeric ID, or key of the product to create the page in
name * Name of the page
description Description of the page and it can include HTML formatting.

POST /api/v1/products/PRJ1/pages

Example CURL command

curl "https://secure.aha.io/api/v1/products/PRJ1/pages" -d '{"page":{"name":"Note 3","description_attributes":{"body":"\u003cp\u003eAn awesome new note\u003c/p\u003e"}}}' -X POST \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json
{
  "page": {
    "name": "Note 3",
    "description_attributes": {
      "body": "<p>An awesome new note</p>"
    }
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "page": {
    "id": "6477599780871494789",
    "name": "Note 3",
    "title": "PRJ1-N-2 Note 3",
    "updated_at": "2017-10-16T19:55:26.309Z",
    "reference_num": "PRJ1-N-2",
    "position": 3,
    "created_at": "2017-10-16T19:55:26.309Z",
    "url": "http://account1.example.org/pages/PRJ1-N-2",
    "resource": "http://account1.example.org/api/v1/pages/PRJ1-N-2",
    "description": {
      "id": "6477599780979157078",
      "body": "<p>An awesome new note</p>",
      "created_at": "2017-10-16T19:55:26.337Z",
      "attachments": [

      ]
    },
    "comments_count": 0
  }
}

GET /api/v1/products/:product_id/pages

Get all pages for a product

Parameters

Name Description
product_id * Numeric ID, or key of the product to get page for

GET /api/v1/products/PRJ1/pages

Example CURL command

curl -g "https://secure.aha.io/api/v1/products/PRJ1/pages" -X GET \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "pages": [
    {
      "id": "1051981226",
      "name": "Title of the first note",
      "title": "PRJ1-N-1 Title of the first note",
      "reference_num": "PRJ1-N-1",
      "url": "http://account1.example.org/pages/PRJ1-N-1",
      "resource": "http://account1.example.org/api/v1/pages/PRJ1-N-1",
      "created_at": "2017-10-16T19:54:35.000Z",
      "parent_id": null
    },
    {
      "id": "666543134",
      "name": "Title of the second note",
      "title": "PRJ1-N-2 Title of the second note",
      "reference_num": "PRJ1-N-2",
      "url": "http://account1.example.org/pages/PRJ1-N-2",
      "resource": "http://account1.example.org/api/v1/pages/PRJ1-N-2",
      "created_at": "2017-10-16T19:54:35.000Z",
      "parent_id": null
    }
  ],
  "pagination": {
    "total_records": 2,
    "total_pages": 1,
    "current_page": 1
  }
}

GET /api/v1/pages/:id

Get a specific page

Parameters

Name Description
id * Numeric ID of the page to be retrieved

GET /api/v1/pages/1051981226

Example CURL command

curl -g "https://secure.aha.io/api/v1/pages/1051981226" -X GET \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "page": {
    "id": "1051981226",
    "name": "Title of the first note",
    "title": "PRJ1-N-1 Title of the first note",
    "updated_at": "2017-10-16T19:54:35.000Z",
    "reference_num": "PRJ1-N-1",
    "position": 1,
    "created_at": "2017-10-16T19:54:35.000Z",
    "url": "http://account1.example.org/pages/PRJ1-N-1",
    "resource": "http://account1.example.org/api/v1/pages/PRJ1-N-1",
    "description": {
      "id": "669149001",
      "body": "Description of note 1",
      "created_at": "2017-10-16T19:54:35.000Z",
      "attachments": [

      ]
    },
    "comments_count": 0
  }
}

PUT /api/v1/pages/:id

Update a page

Parameters

Name Description
id * Numeric ID, or key of the page to be updated
name Name of the page
description Description of the page and it can include HTML formatting.

PUT /api/v1/pages/1051981226

Example CURL command

curl "https://secure.aha.io/api/v1/pages/1051981226" -d '{"page":{"name":"New name for the page"}}' -X PUT \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json
{
  "page": {
    "name": "New name for the page"
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "page": {
    "id": "1051981226",
    "name": "New name for the page",
    "title": "PRJ1-N-1 New name for the page",
    "updated_at": "2017-10-16T19:55:26.774Z",
    "reference_num": "PRJ1-N-1",
    "position": 1,
    "created_at": "2017-10-16T19:54:35.000Z",
    "url": "http://account1.example.org/pages/PRJ1-N-1",
    "resource": "http://account1.example.org/api/v1/pages/PRJ1-N-1",
    "description": {
      "id": "669149001",
      "body": "Description of note 1",
      "created_at": "2017-10-16T19:54:35.000Z",
      "attachments": [

      ]
    },
    "comments_count": 0
  }
}

DELETE /api/v1/pages/:id

Delete a page

Parameters

Name Description
id * Numeric ID, or key of the page to be deleted

DELETE /api/v1/pages/1051981226

Example CURL command

curl "https://secure.aha.io/api/v1/pages/1051981226" -d '' -X DELETE \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json

Response

Status: 204 No Content
  

Overview

API Resources