Category APIs
POSTCreate (Category)
- Description
- Creates categories.
- Request Endpoint
- POST https://<Example api server address>/category
- Parameters
- None.
- cURL syntax
curl --include \ --request POST \ --header "Content-Type: application/json" \ --data-binary "{ \"imageUrl\":\"www.category1.com\", \"name\":\"category1\", \"videoUrl\":\"www.categoryVideo.com\", \"iconUrl\":\"www.icon.com\", \"colorCode\":\"#222fff\", \"heroImageReference\":\"www.image.com\", \"priority\": 18 }" \ 'https://core.dev.Example.net/api/category'
- POST body attributes (JSON)
Attribute Type Use Description name
String Required Name of the category. imageUrl
String Optional The image's URL. videoUrl
String Optional The video's URL. iconUrl
String Required The icon's URL. colorCode
String Optional Hexadecimal color code (valid colorCode examples: "#1f1f1F", "#AFAFAF", "#1AFFa1", "#222fff", "#F00"). heroImageReference
String Optional The heroImageReference's URL. priority
Number Optional Priority for the category, it should be an integer. Default value for this attribute is "1000". - POST body
Headers: Content-Type: application/json
{ "imageUrl": "www.category1.com", "name": "category1", "videoUrl": "www.categoryVideo.com", "iconUrl": "www.icon.com", "colorCode": "#222fff", "heroImageReference": "www.image.com" }
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": { "id": "a209f3f4-cc68-48fa-8464-20d89a6ffb6f", "updatedBy": "", "imageUrl": "www.category1.com", "name": "category1", "videoUrl": "www.categoryVideo.com", "iconUrl": "www.icon.com", "colorCode": "#222fff", "heroImageReference": "www.image.com" }, "detail": null, "error": false, "message": "Creating category successful" }
GETFetch All
- Description
- Fetch all categories existing in the app. By default, categories are sorted based on the "priority" field.
- Request Endpoint
- GET https://<Example api server address>/category
- Parameters
Parameter Type Use Description offset Number Optional Offset to control the results. limit Number Optional Limit to control the results. - cURL syntax
curl --include \ 'https://core.dev.Example.net/api/category'
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": [ { "id": "51c78cbe-0f7f-4cbc-856d-c29f251b70b5", "updatedBy": "", "imageUrl": "www.facebook.com", "name": "music6", "videoUrl": "www.Video.com", "iconUrl": "www.icon.com", "colorCode": "AFAFAF", "heroImageReference": "www.image.com" }, { "id": "fd2f35ec-98df-420f-8460-66462cc93650", "updatedBy": "", "imageUrl": "www.facebook.com", "name": "music4", "videoUrl": "www.Video.com", "iconUrl": "www.icon.com", "colorCode": "123456", "heroImageReference": "www.image.com" }, { "id": "4fc9e634-b8e3-471c-8afc-9da2eae0fd9b", "updatedBy": "", "imageUrl": "www.Updatecatry1.com", "name": "updatedcategory", "videoUrl": "www.categoryVideo.com", "iconUrl": "www.icon.com3", "colorCode": "#222fff", "heroImageReference": "www.image.com" }, { "id": "25cde8c5-76d8-4e6b-a9a8-e6db3370804b", "updatedBy": "", "imageUrl": "www.facebook.com", "name": "updatedcategory2iu", "videoUrl": "www.Video.com", "iconUrl": "www.icon.com", "colorCode": "#222fff", "heroImageReference": "www.image.com" } ], "detail": null, "error": false, "message": "Fetching categories successful" }
PUTUpdate
- Description
- Updates categories.
- Request Endpoint
- PUT https://<Example api server address>/category/{id}
- Parameters
Parameter Type Use Description id String Required UUID of an existing category - cURL syntax
curl --include \ --request PUT \ --header "Content-Type: application/json" \ --data-binary "{ \"imageUrl\":\"www.Updatecatry1.com\", \"videoUrl\":\"www.categoryVideo.com\", \"iconUrl\":\"www.icon.com3\", \"colorCode\":\"#AFAFAF\", \"heroImageReference\":\"www.image.com\", \"priority\": 10 }" \ 'https://core.dev.Example.net/api/category/id'
- PUT body attributes (JSON)
Attribute Type Use Description imageUrl
String Optional The image's URL. videoUrl
String Optional The video's URL. iconUrl
String Required The icon's URL. colorCode
String Optional Hexadecimal color code (valid colorCode examples: "#1f1f1F", "#AFAFAF", "#1AFFa1", "#222fff", "#F00"). heroImageReference
String Optional The heroImageReference's URL. priority
Number Optional Priority for the category, it should be an integer. Default value for this attribute is "1000". - PUT body
Headers: Content-Type: application/json
{ "imageUrl": "www.Updatecatry1.com", "videoUrl": "www.categoryVideo.com", "iconUrl": "www.icon.com3", "colorCode": "#AFAFAF", "heroImageReference": "www.image.com" }
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": { "id": "4fc9e634-b8e3-471c-8afc-9da2eae0fd9b", "updatedBy": "", "imageUrl": "www.Updatecatry1.com", "name": "updatedcategory", "videoUrl": "www.categoryVideo.com", "iconUrl": "www.icon.com3", "colorCode": "#AFAFAF", "heroImageReference": "www.image.com" }, "detail": null, "error": false, "message": "Editing category successful" }
DELETEDelete
- Description
- Deletes a category.
- Request Endpoint
- DELETE https://<Example api server address>/category/{id}
- Parameters
Parameter Type Use Description id String Required UUID of an existing category - cURL syntax
curl --include \ --request DELETE \ 'https://core.dev.Example.net/api/category/id'
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": true, "detail": null, "error": false, "message": "Deleting category successful" }