You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 8
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 | GET http://localhost:3000/api/v2/custom_fields
header: {'X-User-Token': 'Ppteex1dWbEcnNC311NFOrJqNHP98zN2ccMpWEei--ixL50J7uZsnprbOu--WbOcz50zaS48JzyXXZHS9A==', 'X-User-Email': ‘soft.dave99@gmail.com’} | | |
STEP 4: 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 5: 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 |