GET /tags

Returns paginated JSON data about tags.

URL:
/tags

Method:
GET

URL Parameters:

  • none

Data Parameters:

  • page=[integer]
  • count=[integer] number of items returned per page, defaults to 10, max 100

Success Response:
Code: 200 OK
Content: 

{
    "data": [
        {
            "id": 937203467,
            "name": "Awesome",
            "slug": "awesome"
        },
        {
            "id": 1467473860,
            "name": "Sloth",
            "slug": "sloth"
        }
    ],
    "meta": {
        "pagination": {
            "total": 2,
            "count": 2,
            "per_page": 10,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

Error Response: Code: 401 UNAUTHORIZED
Content: 

{ error : "You are unauthorized to make this request." }

GET /tags/{id}

Returns JSON data about a tag.

URL:
/tags/{id}

Method:
GET

URL Parameters:

  • id=[integer] required

Data Parameters:

  • none

Success Response:
Code: 200 OK
Content: 

{
    "data": {
        "id": 937203467,
        "name": "Awesome",
        "slug": "awesome"
    }
}

Error Response: 

Code: 401 UNAUTHORIZED
Content: 

{ 
   "error":{  
      "message":"Unauthenticated.",
      "status":401
   }
}

Code: 404 NOT FOUND
Content: 

{ 
   "error":{  
      "message":"Not Found",
      "status":404
   }
}

POST /tags

Create a new tag.

URL:
/tags

Method:
POST

URL Parameters:

  • none

Data Parameters:

  • none

Body (json): 

{  
   "name":"New Tag"
}

Success Response:
Code: 200 OK
Content: 

{
    "data": {
        "id": 874992931,
        "name": "New Tag",
        "slug": "new-tag-5989a7878d225"
    }
}

Error Response: 

Code: 401 UNAUTHORIZED
Content: 

{ 
   "error":{  
      "message":"Unauthenticated.",
      "status":401
   }
}

Code: 400 BAD REQUEST
Content: 

{ 
   "error":{  
      "message":"The given data failed to pass validation.",
      "status":400
   }
}

PUT /tags/{id}

Updates an existing category.

URL:
/tags/{id}

Method:
PUT

URL Parameters:

  • id=[integer] required

Data Parameters:

  • none

Body (json): 

{  
   "name":"Updated Tag"
}

Success Response:
Code: 200 OK
Content: 

{
    "data": {
        "id": 874992931,
        "name": "Updated tag",
        "slug": "new-tag-5989a7878d225"
    }
}

Error Response: 

Code: 401 UNAUTHORIZED
Content: 

{ 
   "error":{  
      "message":"Unauthenticated.",
      "status":401
   }
}

Code: 400 BAD REQUEST
Content: 

{ 
   "error":{  
      "message":"The given data failed to pass validation.",
      "status":400
   }
}

Code: 404 NOT FOUND
Content: 

{ 
   "error":{  
      "message":"Not Found",
      "status":404
   }
}

DELETE /tags/{id}

Delete an existing tag.

URL:
/tags/{id}

Method:
DELETE

URL Parameters:

  • id=[integer] required

Data Parameters:

  • none

Success Response:
Code: 200 OK

Error Response:
Code: 401 UNAUTHORIZED
Content: 

{ 
   "error":{  
      "message":"Unauthenticated.",
      "status":401
   }
}

Code: 404 NOT FOUND
Content: 

{ 
   "error":{  
      "message":"Not Found",
      "status":404
   }
}
Did this answer your question?