Post a Zero-or-Multiple-Contacts Contacts-STORY API
There are two APIs for posting a story.
API | Story about zero contacts | Story about only one contact | Story about one or more cases of one contact | Story about multiple contacts | Story with anonymous progress (i.e. progress is not tagged to a contact) |
---|---|---|---|---|---|
Post a Multiple-Contacts or Zero Contacts Story API | Yes | Yes | No | Yes | Yes |
No | Yes | Yes | No | No |
If your story is about one or more cases, you should use the Single-Contact Story API
Introduction
Stories are the main content format on Makerble
Every story has a single story category. (The story category contains the current fields (i.e. Survey Questions) that appear on the Create Story page)
Stories can contain
text
media (e.g. image, video, audio, document attachments)
progress towards Changes and Indicators; and that progress can optionally be tagged to individual beneficiaries (called contacts in the front-end)
Every story must belong to a single project
Every story must have a single author who is a user
Front-end Documentation
Logic
Component | Description |
---|---|
Beneficiaries |
|
Story Category |
|
Story Change Beneficiary |
|
Story Change |
|
Story Indicator Beneficiary |
|
Story Indicator |
|
API Documentation
Desc: Post a Zero-or-Multiple-Contacts Story
API call: definitions
Part of the API call | What it means | Front-end documentation |
---|---|---|
“Story”: { | Everything after this point relates to the single story that is being created | |
“story_group” |
|
|
“story_format” |
|
|
“display as” |
|
|
“project_id” | Every story must belong to a single project | |
“charity_id” |
| |
“story category ID” | every story must belong to a single Story Category | |
“event ID” | this only needs to be filled in if the story is tagged to an event | |
latitude |
|
|
longitude |
|
|
draft | The options are: |
|
source of story | The options are: |
|
is_public | The options are: |
|
approved | The options are: |
|
text | This is the default text field within the story.
|
|
story_privacy | The options are: | |
individual_list | Only if you have set the story privacy to Specific Individuals only, must you complete this field with the IDs of the user whom you want to be able to view the story.
|
|
beneficiary IDs |
| |
story_changes |
|
|
Each pair of change_id and number fields |
| |
change_id | If there are |
|
number |
|
|
Story change beneficiaries |
|
|
Each pair of story_change_beneficiary and beneficiary fields |
| |
change_id |
|
|
beneficiary_id |
|
|
Story indicators |
|
|
Story indicator beneficiaries |
|
|
Each quintet (group of five) of fields |
| |
indicator ID |
|
|
indicator type | The options are: |
|
outcome ID | This is the outcome that the indicator should be linked to. (See outcome indicator pairings) |
|
beneficiary indicator value |
|
|
beneficiary ID |
|
|
custom fields |
|
|
[ID of each custom field] | value entered for that custom field |
|
API call: code
url: /stories
method: POST
required: story_category_id, project_id
NOTE: The api supports markdown language for formatting and need to send in text
parameter.
body:
{
"story": {
"story_group": "change_created",
"story_format": "old",
"display_as": "survey_questions_view",
"project_id": 19,
"charity_id": "",
"story_category_id": 327,
"event_id":"" ,
"latitude":"" ,
"longitude": "" ,
"draft": false,
"source_of_story": "one_participant_story_form",
"is_public": false,
"approved": "",
"text": "API TEST"
},
"story_privacy": "only_charity_colleagues",
"individual_list": [],
"beneficiary_ids": [413],
"story_changes": [
{
"change_id": 199,
"number": 2
},
{
"change_id": 230,
"number":2
}
],
"story_change_beneficiaries":[
{
"change_id": 230,
"beneficiary_id": 413
}
],
"story_indicator_beneficiaries":[
{
"indicator_id": 243,
"indicator_type": "scale",
"outcome_id": 145,
"sub_ratio_id": 54,
"beneficiary_id": 413
},
{
"indicator_id": 244,
"indicator_type": "binary",
"outcome_id": 145,
"binray_indicator_value": "on",
"beneficiary_id": 413
},
{
"indicator_id": 242,
"indicator_type": "value",
"outcome_id": 145,
"number": 2,
"beneficiary_id": 413
}
],
"custom_fields": {
"26": "adfasfasf",
"103": "02:05",
"19": "2021-04-25",
"177": "Place"
}
}
Example story created:
Url: https://staging.makerble.com/stories/2408
Screenshot of ANSWERS tab of the Story show page
Screenshot of SUMMARY tab of the Story show page
New Story page: https://staging.makerble.com/projects/project-1/story_categories/327/stories/new
response example: default response example (single record)