Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

This is an example of how to use the Post single story API documentation to create a story

Step

Postman call

Postman response

Equivalent content or page in the front-end

  1. Authenticate

localhost:3000/api/v2/users/sign_in?user[email]=clientaccess20@makerble.com&user[password]=123456

{
    "user_id": 5191,
    "email": "clientaccess20@makerble.com",
    "authentication_token": "uYfRWaONsqjZ8VEaakK9doU59qf4NwgzI3rsOTX7--mhjBlO9sTwCm+b9O--aLFY68Y39+XDLX6FCBcNTQ=="
}

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

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": "ram rajya praja sukhi" }, "story_change_beneficiaries": [], "story_changes": [], "story_indicator_beneficiary": [] }

{
    "id": 190280,
    "text": "ram rajya praja sukhi",
    "number": "0",
    "approved": true,
    "story_group": "change_created",
    "location": null,
    "project_id": 2882,
    "charity_id": null,
    "story_category_id": 3509,
    "edited_by": 5191,
    "user_id": 5191,
    "updated_at": "2022-05-16T18:49:53.843+01:00",
    "created_at": "2022-05-16T18:49:49.000+01:00",
    "actual_created_at": "2022-05-16T18:49:49.587+01:00",
    "beneficiary_ids": [
        78820
    ]
}

8. Get story

  • No labels