Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 1.38 KB

purchase_drafts.md

File metadata and controls

68 lines (49 loc) · 1.38 KB

Purchase Drafts

German: "Ausgaben – Entwürfe"

Attributes

The purchase draft representation is:

{
  "id": 123,
  "title": "Ticket",
  "email_from": "[email protected]",
  "email_body": "here the ticket",
  "user": {
    "id": 933590696,
    "firstname": "John",
    "lastname": "Doe"
  },
  "created_at": "2021-10-17T09:33:46Z",
  "updated_at": "2021-10-17T09:33:46Z"
}

GET /purchases/drafts

Retrieve all drafts:

curl -X GET \
  'https://{domain}.mocoapp.com/api/v1/purchases/drafts' \
  -H 'Authorization: Token token=YOUR_API_KEY'

This returns an array with complete draft information (see attributes).

GET /purchases/drafts/{id}

Retrieve a single draft:

curl -X GET \
  'https://{domain}.mocoapp.com/api/v1/purchases/drafts/{id}' \
  -H 'Authorization: Token token=YOUR_API_KEY'

The response is a single draft representation.

GET /purchases/drafts/{id}.pdf

Retrieve the draft document:

curl -X GET \
  'https://{domain}.mocoapp.com/api/v1/purchases/drafts/{id}.pdf' \
  -H 'Authorization: Token token=YOUR_API_KEY'

This returns this draft's document if it's a PDF. Otherwise it responds with 204 No Content.