eCMRhub.docs

Issue a draft

POST
/functions/v1/publish

Issues one immutable document from a complete draft revision. Issuing the same draft again returns the same document. May need a person's approval.

Authorization

apikeybearerAuth
headerapikey<token>
headerAuthorizationBearer <JWT>

Header Parameters

x-ecmr-approval?string

Id of the approval a person gave for exactly this request. Omitted: a connection that requires approval gets 428 APPROVAL_REQUIRED and the approval to ask for.

Formatuuid

Request Body

application/json
  1. body
draftId*string
Formatuuid
revision*integer
Range1 <= value

Response Body

Success

application/json
  1. response

state is a server-derived value from the type state machine. It is never writable directly.

id*string
Formatuuid
tenantId*string
Formatuuid
type*
reference*string
Length1 <= length <= 200
currentVersionId*string
Formatuuid
state*string
Length1 <= length <= 200
createdAt*string
Formatdate-time
Example Request
curl -X POST 'https://api-ecmr-dev.lucaspiera.com/functions/v1/publish' \  -H 'Content-Type: application/json' \  -d '{  "draftId": "dfb8a430-52c9-4ba8-8878-6bd070da9488",  "revision": 1}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",  "type": {    "name": "string",    "version": "string"  },  "reference": "string",  "currentVersionId": "7d3c5b66-ff6d-477a-9982-96f00519947f",  "state": "string",  "createdAt": "2019-08-24T14:15:22Z"}