Skip to content

sheepForms

Forms in Sheep are built from a hierarchy: questions at the bottom, which can be grouped into a section, sections are added to a form template, and templates are finally made public inside a sheep form.

To construct a form you must start at the bottom and work up:

  1. Define your questions
  2. Group questions into sections (you must have at least one)
  3. Create the form template
  4. Create the Sheep Form that will use the template
Field TypeDescription
booleanYes/no dropdown.
boolean-simpleRenders as checkbox-simple.
boolean-switchRenders as switch with “yes/no”.
choiceSingle choice from a pre-defined list.
choice-from-urlSingle choice defined by an API endpoint.
dateBrowser date input.
emailBrowser email input.
extra-large-textTextarea.
fileSingle file upload.
imageSingle file upload.
profile_photoSingle file upload with link to photo guidance.
large-textTextarea.
multi-choiceMultiple choice from a pre-defined list.
multi-choice-checkboxMultiple choice from a pre-defined list rendered as checkboxes.
multi-choice-from-urlMultiple choices defined by an API endpoint.
multi-fileMultiple file upload.
multi-select-from-urlMultiple select, defined by an API endpoint.
numberBrowser number input.
telephoneBrowser text input.
textBrowser text input.
text-listMultiple text inputs.
timeBrowser text input.
POST https://api.sheepcrm.com/api/v1/$FLOCK/sheep_form/
Authorization: Bearer $API_KEY
Section titled “Create a new sheep form, a new form template and link them”
POST https://api.sheepcrm.com/api/v1/$FLOCK/sheep_form/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"new_form_template": true}
POST https://api.sheepcrm.com/api/v1/$FLOCK/form_template/{ID}/section/
Authorization: Bearer $API_KEY
DELETE https://api.sheepcrm.com/api/v1/$FLOCK/form_template/{ID}/section/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"section_uri": "/example/form_section/5f904b1dcd59d5157793fb08/"}
POST https://api.sheepcrm.com/api/v1/$FLOCK/form_section/{ID}/question/
Authorization: Bearer $API_KEY
DELETE https://api.sheepcrm.com/api/v1/$FLOCK/form_section/{ID}/question/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"question_uri": "/example/form_question/5f904b1dcd59d5157793fb08/"}

The Sheep Forms (templates, sections and questions) define the reusable form that a user will complete. The answers a user provides are stored in a form_response. A form response will have a reference to the form it is referring to and the contact that is completing the form.

StatusDescription
startedThe user is in the process of answering.
submittedThe user has completed and submitted their form. Further user edits are not possible.
withdrawnThe user has asked to withdraw their submission.
acceptedThe response has been accepted (e.g. an application to join) or simply closed/complete.
rejectedThe response was not accepted.

Status fields are configurable but certain statuses are required to exist. As a form response changes state, Sheep trigger events are created which can be connected through actions to deliver automation (e.g. sending an email when a form moves to accepted).

The standard core API can be used to create, update and delete form responses. Deleting a form response will not delete any associated attachments or score sheets.

ParameterDescription
answersA dictionary of question and answers.
questionSingle question (unique, fully qualified name). Use as alternative to answers.
answerSingle answer. Use with question.
skip_validationBoolean. Default is False. Questions are validated against the form before submitting.
PUT https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/answers/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"answers": {"fully-qualified-question": "my answer"}}
HTTP/1.1 200 OK
{
"data": {
"fully-qualified-question": "my answer"
}
}
ParameterDescription
section_uriRequired. The section the comment refers to.
commentThe comment (markdown supported).
POST https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/comment/
Authorization: Bearer $API_KEY
ParameterDescription
section_uriRequired. The section the feedback refers to.
feedbackThe feedback text (markdown supported).
POST https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/feedback/
Authorization: Bearer $API_KEY

Forms can be scored (marked) directly or scored by a separate score sheet. Separate score sheets are only recommended if multiple independent scores are required.

Set the mark/score on the form response directly

Section titled “Set the mark/score on the form response directly”
ParameterDescription
questionRequired. The question the mark or score applies to.
markRequired. The mark or score (numeric, integer).
PUT https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/mark_question/
Authorization: Bearer $API_KEY

Delete / remove / reset mark for a question

Section titled “Delete / remove / reset mark for a question”
DELETE https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/mark_question/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"question": "the-question-name"}
PUT https://api.sheepcrm.com/api/v1/$FLOCK/form_score/{ID}/mark_question/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"question": "the-question-name", "mark": 8}

Delete / remove / reset mark on a score sheet

Section titled “Delete / remove / reset mark on a score sheet”
DELETE https://api.sheepcrm.com/api/v1/$FLOCK/form_score/{ID}/mark_question/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"question": "the-question-name"}
ParameterDescription
userRequired. The scorer.
POST https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/scorer/
Authorization: Bearer $API_KEY
ParameterDescription
score_sheetRequired. The score sheet to delete.
forceOptional. A score sheet will not be deleted if it has been started by the scorer unless forced.
DELETE https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/scorer/
Authorization: Bearer $API_KEY
ParameterDescription
userRequired. The scorer.
score_sheetRequired. The score sheet to modify.
forceOptional. A score sheet will not be modified if it has been started by the scorer unless forced.
PUT https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/scorer/
Authorization: Bearer $API_KEY

Get access to all the scores for a form response, their mean and the totals:

GET https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/scores/
Authorization: Bearer $API_KEY

Users can be assigned/pinned to a form response. What the assignment means will depend on the context and wider configuration. User assignments can be used in conjunction with permissions to control access to certain form responses.

POST https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/users/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"user": "/sheepcrm/user/{uid}/"}
DELETE https://api.sheepcrm.com/api/v1/$FLOCK/form_response/{ID}/users/
Authorization: Bearer $API_KEY
Content-Type: application/json
{"user": "/sheepcrm/user/{uid}/"}