Previous topic

Query for the Menu

Next topic

Query Description items

This Page

Query Category items

The Category endpoint allows you to submit GET requests to retrieve all of the Category items and their attributes.

GET /mping/api/v2/category

Get all available Categories

Example request

GET /mping/api/v2/category HTTP/1.0
Host: mping.ou.edu
Accept: application/json
Request Headers:
 
  • Accept-Language – Optional: if need Category entries in another language supported by the API
  • Content-Type – Optional: requested format type of response (default is json)

Example response

HTTP/1.0 200 OK
Date: Wed, 11 Feb 2015 20:00:59 GMT
Server: WSGIServer/0.1 Python/2.7.9
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json
Content-Language: en-us
Allow: GET, HEAD, OPTIONS

{
    "count": 9,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 8,
            "name": "Test",
            "active": true
        },
        {
            "id": 9,
            "name": "None",
            "active": true
        },
        {
            "id": 1,
            "name": "Rain/Snow",
            "active": true
        },
        {
            "id": 2,
            "name": "Hail",
            "active": true
        },
        {
            "id": 3,
            "name": "Wind Damage",
            "active": true
        },
        {
            "id": 4,
            "name": "Tornado",
            "active": true
        },
        {
            "id": 5,
            "name": "Flood",
            "active": true
        },
        {
            "id": 6,
            "name": "Mudslide",
            "active": true
        },
        {
            "id": 7,
            "name": "Reduced Visibility",
            "active": true
        }
    ]
}
Status Codes:
Response JSON Object:
 
  • count (int) – The total number of Categories matching your query
  • next (string) – provides url to get next page of results otherwise null
  • previous (string) – provides url to get previous page of results otherwise null
  • results (array) – array of Categories matching your query
Response JSON Array of Objects:
 
  • id (int) – primary id of the Category
  • name (string) – name of the Category
  • active (bool) – shows if the Category is active or not