API Documentation

API Endpoint

Report Categories

Report Category

GET /api/v2/report_categories
Requestsreturns categories

GET  /api/v2/report_categories

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "2",
      "type": "report_categories",
      "attributes": {
        "name": "category",
        "position": 1,
        "color_id": null,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "1028"
          }
        }
      }
    },
    {
      "id": "3",
      "type": "report_categories",
      "attributes": {
        "name": "category",
        "position": 1,
        "color_id": null,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "1028"
          }
        }
      }
    },
    {
      "id": "4",
      "type": "report_categories",
      "attributes": {
        "name": "category",
        "position": 1,
        "color_id": null,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "1028"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://api-test.productive.io/api/v2/report_categories?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://api-test.productive.io/api/v2/report_categories?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 3,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get report categories
GET/api/v2/report_categories


GET /api/v2/report_categories/1
Requestsreturns report category

GET  /api/v2/report_categories/5

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "5",
    "type": "report_categories",
    "attributes": {
      "name": "category",
      "position": 1,
      "color_id": null,
      "deleted_at": null
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1029"
        }
      }
    }
  },
  "meta": {}
}

Gets a report category
GET/api/v2/report_categories/{id}

URI Parameters
HideShow
id
number (required) Example: 1

report_category id


POST /api/v2/report_categories
Requestscreates report categoryreturns error

POST  /api/v2/report_categories

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "report_categories",
    "attributes": {
      "name": "category#2",
      "position": 1
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "7",
    "type": "report_categories",
    "attributes": {
      "name": "category#2",
      "position": 1,
      "color_id": null,
      "deleted_at": null
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1030"
        }
      }
    }
  },
  "meta": {}
}

POST  /api/v2/report_categories

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "report_categories",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Create a report category
POST/api/v2/report_categories

URI Parameters
HideShow
name
string (required) Example: Name

name


PATCH /api/v2/report_categories/1
Requestsupdates report categoryreturns error

PATCH  /api/v2/report_categories/9

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "report_categories",
    "attributes": {
      "name": "category#2"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "9",
    "type": "report_categories",
    "attributes": {
      "name": "category#2",
      "position": 1,
      "color_id": null,
      "deleted_at": null
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1032"
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/report_categories/10

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "report_categories",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a report category
PATCH/api/v2/report_categories/{id}

URI Parameters
HideShow
id
number (required) Example: 1

report_category id


DELETE /api/v2/report_categories/1
Requestssoft deletes report categorynullifies report_categories on association

DELETE  /api/v2/report_categories/11

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses204
This response has no content.

DELETE  /api/v2/report_categories/12

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a report category
DELETE/api/v2/report_categories/{id}

URI Parameters
HideShow
id
number (required) Example: 1

report_category id


Generated by aglio on 19 Apr 2024