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 14 Next »

This example includes the steps of

step

postman call

postman response

content in front-end

STEP 1: login

POST

http://localhost:3000/api/v2/users/sign_in?user[email]=soft.dave99@gmail.com&user[password]=123456

{
    "user_id": 368,
    "email": "soft.dave99@gmail.com",
    "authentication_token": "vB4J9TJMLGnZnV4DMZlvPTWimman1gxpo2AoechN--8EELxNTE4I6Ih5Aa--dmDINUcdLkimLXnlrnKJhA=="
}

STEP 2: get beneficiary categories

GET
http://localhost:3000/api/v2/beneficiary_categories

header: {'X-User-Token': 'Ppteex1dWbEcnNC311NFOrJqNHP98zN2ccMpWEei--ixL50J7uZsnprbOu--WbOcz50zaS48JzyXXZHS9A==',
'X-User-Email': ‘soft.dave99@gmail.com’}

manage beneficiary categories page

STEP 3: get custom fields from a beneficiary category

(This gives you the fields within the beneficiary category, i.e. the text fields, number fields, date fields, time fields, section dividers, attachment field and ratio sets (list fields))

GET
http://localhost:3000/api/v2/custom_fields?beneficiary_category_ids[]=294

header: {'X-User-Token': 'Ppteex1dWbEcnNC311NFOrJqNHP98zN2ccMpWEei--ixL50J7uZsnprbOu--WbOcz50zaS48JzyXXZHS9A==',
'X-User-Email': ‘soft.dave99@gmail.com’}

STEP 4: get sub ratios from a ratio set

(These are the answer choices within a list field)

GET
http://localhost:3000/api/v2/sub_ratios?ratio_set_ids[]=11

header: {'X-User-Token': 'Ppteex1dWbEcnNC311NFOrJqNHP98zN2ccMpWEei--ixL50J7uZsnprbOu--WbOcz50zaS48JzyXXZHS9A==',
'X-User-Email': ‘soft.dave99@gmail.com’}

STEP 5: Ratio Set Choiceable

(This determines whether the list field is unlimited multiple choice, limited multiple choice or single choice)

GET
http://localhost:3000/api/v2/ratio_set_choiceables?beneficiary_category_ids[]=294

header: {'X-User-Token': 'Ppteex1dWbEcnNC311NFOrJqNHP98zN2ccMpWEei--ixL50J7uZsnprbOu--WbOcz50zaS48JzyXXZHS9A==',
'X-User-Email': ‘soft.dave99@gmail.com’}

STEP 6: create beneficiary

POST
http://localhost:3000/api/v2/beneficiaries

body: { "beneficiary": { "name": "Python New 123", "date_of_birth": "13-05-1899", "address": "Paris", "latitude": "48.856613", "longitude": "2.352222", "beneficiary_type_id": 1, "owner_id": 237 }, "project_ids": [572], "custom_fields": {"190": "test.john@gmail.com", "173": "1234567890", "103": "10:16", "322": "2022-03-12"}, "sub_ratios": {"11": [35, 36]}, "beneficiary_category_ids": [294] }



header: {'X-User-Token': 'Ppteex1dWbEcnNC311NFOrJqNHP98zN2ccMpWEei--ixL50J7uZsnprbOu--WbOcz50zaS48JzyXXZHS9A==',
'X-User-Email': ‘soft.dave99@gmail.com’}

create beneficiary page - using that beneficiary category

STEP 7: show beneficiary

GET
http://localhost:3000/api/v2//beneficiaries/:id

header: {'X-User-Token': 'Ppteex1dWbEcnNC311NFOrJqNHP98zN2ccMpWEei--ixL50J7uZsnprbOu--WbOcz50zaS48JzyXXZHS9A==',
'X-User-Email': ‘soft.dave99@gmail.com’}

beneficiary profile page

  • No labels