This is an example document contains several examples of how to use the Post single story API documentation to create a story
Example 1: a story that tags only 1 beneficiary (contact)
Step | Postman call | Postman response | Equivalent content or page in the front-end |
---|
Authenticate
| localhost:3000/api/v2/users/sign_in?user[email]=soft.dave99@gmail.com &user[password]=123456 | Code Block |
---|
{
"user_id": 2044,
"email": "soft.dave99@gmail.com",
"authentication_token": "b7c+D5o0joNRXMVNycN696yJZkuWshy4Zw66qWSJ--tT63Ev/FYFl00rCr--WomZk6tiLoXtapKgB/EtZA=="
} |
| |
2. Get projects | | | |
3. Get project's story categories | | | |
4. Get story categories | | | |
5. Get metrics? Get fields? | | | |
6. Get project beneficiaries | | | |
7. Post story | localhost:3000/api/v2/stories header: {“X-User-Token”: b7c+D5o0joNRXMVNycN696yJZkuWshy4Zw66qWSJ--tT63Ev/FYFl00rCr--WomZk6tiLoXtapKgB/EtZA==, “X-User-Token”: “soft.dave99@gmail.com“} body_parameters: { "beneficiary_ids": [78820], "case_ids": [], "custom_fields": {}, "story": { "story_format": "old", "story_group": "change_created", "project_id": 2882, "source_of_story": "android_mobile_app", "story_category_id": 3509, "text": "test story create" }, "story_change_beneficiaries": [], "story_changes": [], "story_indicator_beneficiary": [] }
| Code Block |
---|
{
"id": 190282,
"text": "test story create",
"number": "0",
"approved": true,
"story_group": "change_created",
"location": null,
"project_id": 2882,
"charity_id": null,
"story_category_id": 3509,
"edited_by": 2044,
"user_id": 2044,
"updated_at": "2022-05-16T19:22:44.353+01:00",
"created_at": "2022-05-16T19:22:41.000+01:00",
"actual_created_at": "2022-05-16T19:22:41.573+01:00",
"beneficiary_ids": [
78820
]
} |
| |
8. Get story | | | |
Example 2: a story that tags several beneficiaries
Step | Postman call | Postman response | Equivalent content or page in the front-end |
---|
Authenticate
| | | |
2. Get projects | | | |
3 Get project's story categories | | | |
4 Get story categories | | | |
5 Get metrics? Get fields? | | | |
6 Get project beneficiaries | | | |
7 Post story | | | |
8Get story | | | |