Claim a letter for editing
const url = 'https://api.tryletterhead.com/api/v3/letters/example/claim';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"claimant":"{\"uniqueId\":\"user-abc123\",\"name\":\"Jane Doe\"}"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryletterhead.com/api/v3/letters/example/claim \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "claimant": "{\"uniqueId\":\"user-abc123\",\"name\":\"Jane Doe\"}" }'Claim a letter for editing so other editors are warned itβs in use. claimant is a JSON-encoded
string identifying whoβs claiming it β it must decode to an object carrying at minimum a
uniqueId field identifying the claiming editor.
If the letter is already claimed by someone else, the claim fails and the response names the current claimant.
Authorizations
Section titled βAuthorizations βParameters
Section titled β Parameters βPath Parameters
Section titled βPath Parameters βThe letterβs unique identifier β an alphanumeric string around ten characters, e.g. ludctamgd6.
Request Body required
Section titled βRequest Body required βobject
A JSON-encoded object that must include a uniqueId field, e.g. '{"uniqueId":"user-abc123","name":"Jane Doe"}'.
Example
{ "claimant": "{\"uniqueId\":\"user-abc123\",\"name\":\"Jane Doe\"}"}Responses
Section titled β Responses βClaim succeeded
Example
This letter's all yours. Enjoy.The claimant value is malformed β it didnβt decode to an object with a uniqueId.
The letter is already claimed by someone else. The response body names the current claimant.
Still can’t find what you need? Contact support.