Skip to content

Latest commit

 

History

History
101 lines (73 loc) · 2.06 KB

deal_categories.md

File metadata and controls

101 lines (73 loc) · 2.06 KB

Deal Categories

German: "Akquise-Stufen"

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).

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.