Deal Categories
German: “Akquise-Stufen”
- Attributes
- GET /deal_categories
- GET /deal_categories/{id}
- POST /deal_categories
- PUT /deal_categories/{id}
- DELETE /deal_categories/{id}
Attributes
The deal category representation is:
{
"id": 123,
"name": "Contact",
"probability": 1,
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
GET /deal_categories
Retrieve all categories:
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/deal_categories' \
-H 'Authorization: Token token=YOUR_API_KEY'
This returns an array with complete category information (see attributes).
Additionally, the following parameters can be supplied:
GET /deal_categories/{id}
Retrieve a single category:
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/deal_categories/{id}' \
-H 'Authorization: Token token=YOUR_API_KEY'
The response is a single category representation.
POST /deal_categories
Create a category:
curl -X POST \
'https://{domain}.mocoapp.com/api/v1/deal_categories' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "New Category",
"probability": 15,
}'
Mandatory fields are marked with a star (*):
- name* – “New Category”
- probability* – 15
PUT /deal_categories/{id}
Update a category:
curl -X PUT \
'https://{domain}.mocoapp.com/api/v1/deal_categories/{id}' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "New Name"
}'
Fields are analogous to the POST request.
DELETE /deal_categories/{id}
Delete a category.
curl -X DELETE \
'https://{domain}.mocoapp.com/api/v1/deal_categories/{id}' \
-H 'Authorization: Token token=YOUR_API_KEY'
Response code is no-content on success. If the category is in use then the delete fails and response code is forbidden.