Category
Prerequisites #
- To use the Social Feed API, you must first authenticate yourself and receive a token enables you to access the service. See the Authentication documentation for more information on how to do this.
- Category endpoints need a
categoryIdas path parameter.
Requests #
Category resource provides the following endpoints:
| Path | HTTP Method | Description |
|---|---|---|
| v1/categories/ | GET | View categories |
| v1/categories/ | POST | Create a new category |
| v1/categories/latestPosts | GET | View latest created posts in all categories |
| v1/categories/{categoryId} | GET | View a specified category |
| v1/categories/{categoryId} | PUT | Update an existing category |
| v1/categories/{categoryId} | DEL | Delete an existing category |
| v1/categories/{categoryId}/latestPosts | GET | View latest created posts for a specified category |
See the API documentation documentation for more information on these endpoints
Example Request #
The following example curl command demonstrates how to get a specified category.
In a Linux/Unix/macOS environment:
In Windows PowerShell:
Responses #
- If successful, the operation responds with HTTP status code 2XX.
- If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.
- If the authenticating user is not active, the operation returns the
Access is deniederror. - If the authenticating user or the specified category does not exist, the operation returns the
Not founderror. - If the specified category is already exist, the operation returns the
Conflicterror.- If the Authorization header is not present or invalid, a 401 error code will be returned.
- If the authenticating user is not active, the operation returns the