German: "Akquise-Stufen"
- Attributes
- GET /deal_categories
- GET /deal_categories/{id}
- POST /deal_categories
- PUT /deal_categories/{id}
- DELETE /deal_categories/{id}
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"
}
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).
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.
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
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 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.