Competitors API


GET /api/v1/products/:product_id/competitors

Get a list of all of the competitors in a product

Parameters

Name Description
product_id * Numeric ID, or key of the product to retrieve competitors for

GET /api/v1/products/PRJ1/competitors

Example CURL command

curl "https://secure.aha.io/api/v1/products/PRJ1/competitors" -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
{
  "competitors": [
    {
      "id": "457085224",
      "name": "JIRA",
      "created_at": "2017-05-31T20:12:50.000Z"
    },
    {
      "id": "892399625",
      "name": "ProductPlan",
      "created_at": "2017-05-31T20:12:50.000Z"
    },
    {
      "id": "741974453",
      "name": "Roadmunk",
      "created_at": "2017-05-31T20:12:50.000Z"
    }
  ],
  "pagination": {
    "total_records": 3,
    "total_pages": 1,
    "current_page": 1
  }
}

GET /api/v1/competitors/:id

Get specific competitor

Parameters

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

GET /api/v1/competitors/892399625

Example CURL command

curl "https://secure.aha.io/api/v1/competitors/892399625" -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
{
  "persona": {
    "id": "892399625",
    "name": "ProductPlan",
    "color": 29647,
    "created_at": "2017-05-31T20:12:50.000Z",
    "updated_at": "2017-05-31T20:12:50.000Z",
    "url": "http://account1.example.org/competitors/892399625",
    "resource": "http://account1.example.org/competitors/892399625",
    "custom_fields": [

    ],
    "comments_count": 1
  }
}

GET /api/v1/competitors

Search for competitors by name

Parameters

Name Description
q Sub-string to match against competitor name

GET /api/v1/competitors?q=Roadmunk

Example CURL command

curl "https://secure.aha.io/api/v1/competitors?q=Roadmunk" -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
{
  "competitors": [
    {
      "id": "741974453",
      "name": "Roadmunk",
      "created_at": "2017-05-31T20:12:50.000Z"
    }
  ],
  "pagination": {
    "total_records": 1,
    "total_pages": 1,
    "current_page": 1
  }
}

POST /api/v1/products/:product_id/competitors

Create a competitor

Parameters

Name Description
product_id * Numeric ID, or key of the product to create the competitor in
name * Name of the competitor
color * Hex color of the competitor in the Aha! UI

POST /api/v1/products/PRJ1/competitors

Example CURL command

curl "https://secure.aha.io/api/v1/products/PRJ1/competitors" -d '{"competitor":{"name":"Trello","color":29647}}' -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
{
  "competitor": {
    "name": "Trello",
    "color": 29647
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "persona": {
    "id": "6426394543640379340",
    "name": "Trello",
    "color": 29647,
    "created_at": "2017-05-31T20:12:57.968Z",
    "updated_at": "2017-05-31T20:12:58.107Z",
    "url": "http://account1.example.org/competitors/6426394543640379340",
    "resource": "http://account1.example.org/competitors/6426394543640379340",
    "custom_fields": [

    ],
    "comments_count": 0
  }
}

PUT /api/v1/products/:product_id/competitors/:id

Update a competitor

Parameters

Name Description
product_id * Numeric ID, or key of the product to create the competitor in
id * Numeric ID, or key of the competitor to be updated
name Name of the competitor
color Hex color of the competitor in the Aha! UI

PUT /api/v1/products/PRJ1/competitors/892399625

Example CURL command

curl "https://secure.aha.io/api/v1/products/PRJ1/competitors/892399625" -d '{"competitor":{"name":"Julie"}}' -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
{
  "competitor": {
    "name": "Julie"
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "persona": {
    "id": "892399625",
    "name": "Julie",
    "color": 29647,
    "created_at": "2017-05-31T20:12:50.000Z",
    "updated_at": "2017-05-31T20:12:58.198Z",
    "url": "http://account1.example.org/competitors/892399625",
    "resource": "http://account1.example.org/competitors/892399625",
    "custom_fields": [

    ],
    "comments_count": 1
  }
}

DELETE /api/v1/products/:product_id/competitors/:id

Delete competitor

Parameters

Name Description
product_id * Numeric ID, or key of the product to create the competitor in
id * Numeric ID, or key of the competitor to be deleted

DELETE /api/v1/products/PRJ1/competitors/892399625

Example CURL command

curl "https://secure.aha.io/api/v1/products/PRJ1/competitors/892399625" -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