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.