•••
 
Documentation   /   API   /   API: Doing task actions
 
 

API: Doing task actions

 

Use /hook to send a value into a task, for example when a background check comes back, a payment is confirmed or another system makes a decision.

Endpoint

POST https://plainly.com/hook

Parameters

Parameter Required Description
task Yes The key of the task. In the workflow this is {{checklist_key}}.
for Yes The ---id of the item to complete.
answer Yes The value for the item. It must pass the item's ---string_format, if it has one. For a question, send the text of one of its answers.
actioner No A name or identifier for whoever took the action, recorded in the task's history. Useful when they aren't logged in to Plainly.
redirect No A URL to redirect to on success.

Which items can be completed

The item must be showing, not already done, and one of these actions: hook, question, text_input, attachment or hidden. A hidden item can be updated even if it's already done.

Example

curl -X POST https://plainly.com/hook \
  --data-urlencode "task=1a2b3c4d5e6f7g8h" \
  --data-urlencode "for=dbs_result" \
  --data-urlencode "answer=clear" \
  --data-urlencode "actioner=DBS checking service"

Responses

/hook returns plain text.

Status Body Meaning
200 Success The item was completed. With redirect, you're redirected instead.
400 Nothing sent. The request was empty.
400 Your request was in the wrong format. There was no answer.
400 Your answer is in the wrong format. {reason} The answer failed ---string_format.
400 That checklist isn't accepting requests at the moment. The task is completed, deleted or killed, or has no items.
400 That checklist item isn't accepting requests at the moment. The item doesn't exist, is already done, or can't be completed externally.
400 or 404 Not sure what you're referring to. task or for was missing, or the task wasn't found.
500 Technical error. A problem on Plainly's side.

Workflows can tell another system which task and item to call back by sending {{checklist_key}} in a payload. See Integration actions.