4. Get story categories: because if getting the project’s story categories does not tell you the metrics and fields (i.e. survey questions) that are within the story categories themselves, you will need to get the survey questions by getting the Story Category before you create your first story. (You do not need to do this each time you create a story) | 5. Get metrics? Get fields? | 6. Get project beneficiaries: because if you are creating a story about a beneficiary, you need to know which beneficiaries are in the project that the story belongs to. (You do not need to do this each time you create a story) | 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": [] }===================================== One Participant ===================================== body parameters Code Block | {
"story": {
"story_group": "change_created"GET localhost:3000/api/v2/story_categories/841 header: {“X-User-Token”: b7c+D5o0joNRXMVNycN696yJZkuWshy4Zw66qWSJ--tT63Ev/FYFl00rCr--WomZk6tiLoXtapKgB/EtZA==, “X-User-Token”: “souleditor@makerble.com“}
for get single story category need to pass 'id = 841' like above url | Code Block |
---|
{
"id": 841,
"name": "Example Survey",
"color": "#f16e20",
"updated_at": "2022-05-24T09:33:38.022+01:00",
"created_at": "2022-05-24T09:33:38.022+01:00",
"is_stopped": false,
"is_default": false,
"description": "",
"intro_message": "",
"current_fields": [
{
"id": 14397,
"storyfield_formatid": "old"177,
"projectfield_idname": "572Location",
"storyfield_categoryclass_idname": "841CustomField",
"source_of_story "priority": "android_mobile_app",3,
"textis_mandatory": "case test",false,
"createddisplay_atinfo": "2022-05-24mouseover",
"storydocument_changescategory_attributesid": {null
},
"45048d65": { {
"change_id": "276"14403,
"field_id": 577,
"number": "5" "field_name": "aa test }indicator",
"05d83e67field_class_name": {"Indicator",
"change_id"priority": "274"9,
"number": "4""is_mandatory": false,
}"display_info": "mouseover",
"0509f592document_category_id": {
null,
"changeoutcome_id": "260",
528,
"numberindicator_type": "6scale"
},
} {
} }, "beneficiariesid": ["160498"]14404,
"case_ids": ["96"], "customfield_fieldsid": { 578,
"352field_name": "1991-02-21testing 3027",
"353 "field_class_name": "11:30Indicator",
"177priority": "Lunawada"10,
"354is_mandatory": "11:45",false,
"4display_info": "2022-05-24mouseover",
"190 "document_category_id": "ajay@gmail.com"null,
"324 "outcome_id": "Hello Everyone"528,
}, "story_indicator_beneficiariestype": {"scale"
"78b138d1": {},
"indicator_id": "577",{
"indicator_typeid": "scale"14405,
"outcomefield_id": "528"363,
"subfield_ratio_idname": ["927"]How long do you think it takes to fly to the }sun?",
"45ebc5de "field_class_name": {"Indicator",
"indicator_idpriority": "578"11,
"indicatoris_typemandatory": "scale"false,
"outcomedisplay_idinfo": "528mouseover",
"subdocument_ratiocategory_id": ["930"]
null,
}, "18c5bdb9outcome_id": {224,
"indicator_idtype": "363value",
},
"indicator_type": "value", {
"outcome_idid": "224"14406,
"numberfield_id": "3"364,
}, "field_name": "Are you "b1a328d1": {happy?",
"indicatorfield_class_idname": "364Indicator",
"indicator_typepriority": "binary"12,
"outcomeis_idmandatory": "224"false,
"binraydisplay_indicator_valueinfo": "onmouseover",
},
"47e3dad5document_category_id": {null,
"indicatoroutcome_id": "8"224,
"indicator_type": "binary",
},
"outcome_id": "2", {
"binray_indicator_valueid": "on"
14407,
}, "8f0e789bfield_id": {8,
"indicatorfield_idname": "455",# and % children engaged in under-age or hazardous labour",
"indicator_type": "value", "outcome_id"field_class_name": "271Indicator",
"numberpriority": "7"
13,
} } } | Code Block |
---|
{
"id"is_mandatory": 190282false,
"text": "test story create", "numberdisplay_info": "0mouseover",
"approved": true, "storydocument_category_groupid": "change_created"null,
"location": null, "projectoutcome_id": 2882,2,
"charityindicator_idtype": null,"binary"
},
{
"story_category_id": 350914408,
"edited_by": 2044, "userfield_id": 2044276,
"updated_at "field_name": "2022-05-16T19:22:44.353+01:00",AA Attendance",
"created_at": "2022-05-16T19:22:41.000+01:00", "actualfield_createdclass_atname": "2022-05-16T19:22:41.573+01:00Change",
"beneficiary_ids "priority": [14,
78820 ]
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null,
"change_type": "participation"
},
{
"id": 14409,
"field_id": 274,
"field_name": "A* attendance",
"field_class_name": "Change",
"priority": 15,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null,
"change_type": "activity"
},
{
"id": 14410,
"field_id": 260,
"field_name": "ActivityIndicatorTest1",
"field_class_name": "Change",
"priority": 16,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null,
"change_type": "activity"
},
{
"id": 14411,
"field_id": 455,
"field_name": "Number of times that the child goes playing outside all by themselves per week",
"field_class_name": "Indicator",
"priority": 17,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null,
"outcome_id": 271,
"indicator_type": "value"
},
{
"id": 14412,
"field_id": 4,
"field_name": "Date founded",
"field_class_name": "CustomField",
"priority": 18,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null
},
{
"id": 14413,
"field_id": 190,
"field_name": "email",
"field_class_name": "CustomField",
"priority": 19,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null
},
{
"id": 14414,
"field_id": 324,
"field_name": "Ideas suggested by the participant",
"field_class_name": "CustomField",
"priority": 20,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null
},
{
"id": 14415,
"field_id": 350,
"field_name": "test attachment 1",
"field_class_name": "CustomField",
"priority": 0,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null
},
{
"id": 14416,
"field_id": 351,
"field_name": "test attachment 2",
"field_class_name": "CustomField",
"priority": 1,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null
},
{
"id": 14417,
"field_id": 352,
"field_name": "test date 2",
"field_class_name": "CustomField",
"priority": 2,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null
},
{
"id": 14418,
"field_id": 353,
"field_name": "test time. 1",
"field_class_name": "CustomField",
"priority": 3,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null
},
{
"id": 14419,
"field_id": 354,
"field_name": "test time 2",
"field_class_name": "CustomField",
"priority": 4,
"is_mandatory": false,
"display_info": "mouseover",
"document_category_id": null
}
],
"scale_indicator_choices": [
{
"id": 354,
"indicator_id": 577,
"choice": "single_choice",
"choice_value": ""
},
{
"id": 355,
"indicator_id": 578,
"choice": "single_choice",
"choice_value": ""
}
]
} |
| |
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": [] }
===================================== One Participant ===================================== body parameters Code Block |
---|
{
"story": {
"story_group": "change_created",
"story_format": "old",
"project_id": "572",
"story_category_id": "841",
"source_of_story": "android_mobile_app",
"text": "case test",
"created_at": "2022-05-24",
"story_changes_attributes": {
"45048d65": {
"change_id": "276",
"number": "5"
},
"05d83e67": {
"change_id": "274",
"number": "4"
},
"0509f592": {
"change_id": "260",
"number": "6"
}
}
},
"beneficiaries": ["160498"],
"case_ids": ["96"],
"custom_fields": {
"352": "1991-02-21",
"353": "11:30",
"177": "Lunawada",
"354": "11:45",
"4": "2022-05-24",
"190": "ajay@gmail.com",
"324": "Hello Everyone"
},
"story_indicator_beneficiaries": {
"78b138d1": {
"indicator_id": "577",
"indicator_type": "scale",
"outcome_id": "528",
"sub_ratio_id": ["927"]
},
"45ebc5de": {
"indicator_id": "578",
"indicator_type": "scale",
"outcome_id": "528",
"sub_ratio_id": ["930"]
},
"18c5bdb9": {
"indicator_id": "363",
"indicator_type": "value",
"outcome_id": "224",
"number": "3"
},
"b1a328d1": {
"indicator_id": "364",
"indicator_type": "binary",
"outcome_id": "224",
"binray_indicator_value": "on"
},
"47e3dad5": {
"indicator_id": "8",
"indicator_type": "binary",
"outcome_id": "2",
"binray_indicator_value": "on"
},
"8f0e789b": {
"indicator_id": "455",
"indicator_type": "value",
"outcome_id": "271",
"number": "7"
}
}
} |
| 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
]
} |
===================================== One Participant ===================================== postman response
Code Block |
---|
{
"id": 127311,
"text": "case test",
"number": "0",
"approved": true,
"story_group": "change_created",
"location": null,
"project_id": 572,
"charity_id": null,
"story_category_id": 841,
"edited_by": 190,
"user_id": 190,
"updated_at": "2022-05-24T13:32:07.923+01:00",
"created_at": "2022-05-24T13:32:05.000+01:00",
"actual_created_at": "2022-05-24T13:32:05.718+01:00",
"beneficiary_ids": [
160498
],
"case_ids": [
96
],
"custom_fields": [
{
"id": 352,
"name": "test date 2",
"type": "date",
"value": "1991-02-21"
},
{
"id": 353,
"name": "test time. 1",
"type": "time",
"value": "11:30"
},
{
"id": 177,
"name": "Location",
"type": "text",
"value": "Lunawada"
},
{
"id": 354,
"name": "test time 2",
"type": "time",
"value": "11:45"
},
{
"id": 4,
"name": "Date founded",
"type": "date",
"value": "2022-05-24"
},
{
"id": 190,
"name": "Email",
"type": "text",
"value": "ajay@gmail.com"
},
{
"id": 324,
"name": "Ideas suggested by the participant",
"type": "text",
"value": "Hello Everyone"
}
],
"story_indicator_beneficiaries": [
{
"id": 33101,
"beneficiary_id": 160498,
"indicator_id": 577,
"indicator_type": "scale",
"sub_ratio_id": 927,
"outcome_id": 528
},
{
"id": 33102,
"beneficiary_id": 160498,
"indicator_id": 578,
"indicator_type": "scale",
"sub_ratio_id": 930,
"outcome_id": 528
},
{
"id": 33103,
"beneficiary_id": 160498,
"indicator_id": 363,
"indicator_type": "value",
"number": 3.0,
"outcome_id": 224
},
{
"id": 33104,
"beneficiary_id": 160498,
"indicator_id": 364,
"indicator_type": "binary"
},
{
"id": 33105,
"beneficiary_id": 160498,
"indicator_id": 8,
"indicator_type": "binary"
},
{
"id": 33106,
"beneficiary_id": 160498,
"indicator_id": 455,
"indicator_type": "value",
"number": 7.0,
"outcome_id": 271
}
],
"story_change_beneficiaries": [
{
"id": 36774,
"beneficiary_id": 160498,
"change_id": 276
},
{
"id": 36775,
"beneficiary_id": 160498,
"change_id": 274
},
{
"id": 36776,
"beneficiary_id": 160498,
"change_id": 260
}
],
"story_changes": [
{
"id": 37477,
"change_id": 276,
"number": 5
},
{
"id": 37478,
"change_id": 274,
"number": 4
},
{
"id": 37479,
"change_id": 260,
"number": 6 }
]
} |
| One Participant Story Created ScreenShot Image Removed |