Some questions @matthias :
- I am logging in correctly with credentials via cURL but not able to authenticate with the
/auth/authenticate
endpoint. Here is the request made:
curl -X "POST" "http://api.climategains.org:9092/api/v1/auth/authenticate" \
-H 'x-api-key: rpA94jzJjrBh9IclvNKvM34xhHwo282g7qZ6mJ0sKITOBy39' \
-H 'Content-Type: text/plain; charset=utf-8' \
-d $'{
"otp": "123456"
}
- Accessing the
/programmes
endpoint provides me with action templates - not the actions themselves. We would like the app to display the results of user actions and not those templates (which are managed by an admin)? Therefore the actions index should be calling the /projects
endpoint. Calling this endpoint returns a 401 Unauthorised Error.
curl "http://api.climategains.org:9092/api/v1/projects" \
-H 'x-api-key: rpA94jzJjrBh9IclvNKvM34xhHwo282g7qZ6mJ0sKITOBy39' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"email": "owen@edgeryders.eu",
"password": "password_hidden"
}'
- If we are to use this endpoint, in what manner are we storing the JSON data (media, meta, steps) under each entry? I see an array for “steps”, but it does not correspond to all the data points we need in the app. This is kind of important if we want the UI to display coherent examples in the demo. We discussed storing the JSON as raw text in a value but it seems important to establish an example in the current backend?
The dummy JSON response currently used in the app below will require quite a bit of fleshing out in the backend if we want to demonstrate a complete action in the demo.
{
"response": [{
"id": "12982",
"meta": {
"title": "Bisate Reforestation Program",
"createdAt": "2022-12-01T16:49:00.370Z",
"author": "479c55b5-0731-4ad9-9012-a9e56f341399",
"icon": "tree",
"location": {
"lat": "0.317714",
"long": "32.5813539",
"town": "Kampala",
"country": "Rwanda",
"iso": "RWA"
},
"funding": {
"source": "Climate Gains",
"currency": "EUR",
"total": 1670,
"carbon": 1200,
"hours": 40
}
},
"media": {
"poster": "https://wsimages.wilderness-safaris.com/uploads/medium/file/20546/small_focal_Bisate_44.jpg",
"video": {
"url": "https://2050today.org/wp-content/uploads/2020/07/Video-Placeholder.mp4?_=1",
"caption": "video caption"
},
"gallery": [{
"url": "https://imagizer.imageshack.com/img924/4753/dvNGXY.jpg",
"caption": ""
},
{
"url": "https://imagizer.imageshack.com/img922/2741/vNdRs7.jpg",
"caption": ""
},
{
"url": "https://imagizer.imageshack.com/img923/5967/Lh2ymu.jpg",
"caption": ""
}
]
},
"steps": [{
"title": "Installation of Counters",
"funds": "400",
"hours": 10,
"materials": "Wood, tiles, tools",
"risks": "Must conform to health and safety guidelines",
"technical_support": {
"name": "",
"address": "",
"phone": "",
"email": ""
},
"suppliers": [
2872892,
2387872,
238738237
]
},
{
"title": "Purchase of Materials",
"funds": "350",
"hours": 5,
"risks": "Supply chain issues could slow down the process",
"materials": "Transportation",
"technical_support": false,
"suppliers": [
2872892,
2387872,
238738237
]
},
{
"title": "Installation of Stoves",
"funds": "1000",
"hours": 25,
"risks": "Supply chain issues could slow down the process",
"materials": "Transportation",
"technical_support": false,
"suppliers": [
2872892,
2387872,
238738237
]
}
],
"application": {
"user_id": "479c55b5-0731-4ad9-9012-a9e56f341338",
"status": "pending",
"contract": "uid",
"questions": [{
"text": "Tell us how you plan to execute this project?",
"duration": 200
},
{
"text": "Question 2",
"duration": 200
}
]
}
},
{
"id": "12983",
"meta": {
"title": "Kabulosake Solar Farm",
"createdAt": "2022-12-01T16:49:00.370Z",
"author": "479c55b5-0731-4ad9-9012-a9e56f341399",
"currency": "euro",
"icon": "sun",
"location": {
"lat": "-0.208333",
"long": "31.497778",
"country": "Uganda",
"iso": "UGA"
},
"funding": {
"source": "ClimateGains",
"total": 1600,
"currency": "EUR",
"carbon": 700
}
},
"media": {
"poster": "url",
"video": {
"url": "https://",
"caption": "djaksdjsdk ds asjl "
},
"gallery": [{
"url": "",
"caption": ""
},
{
"url": "",
"caption": ""
},
{
"url": "",
"caption": ""
}
]
},
"steps": {
"step_1": {
"title": "Installation of Counters",
"funds": "400",
"hours": 10,
"materials": "Wood, tiles, tools",
"risks": "Must conform to health and safety guidelines",
"technical_support": {
"name": "",
"address": "",
"phone": "",
"email": ""
},
"suppliers": [
2872892,
2387872,
238738237
]
},
"step_2": {
"title": "Purchase of Materials",
"funds": "350",
"hours": 5,
"risks": "Supply chain issues could slow down the process",
"materials": "Transportation",
"technical_support": false,
"suppliers": [
2872892,
2387872,
238738237
]
},
"step_3": {
"title": "Installation of Stoves",
"funds": "1000",
"hours": 25,
"risks": "Supply chain issues could slow down the process",
"materials": "Transportation",
"technical_support": false,
"suppliers": [
2872892,
2387872,
238738237
]
}
},
"questions": [{
"text": "Tell us how you plan to execute this project?",
"duration": 200
}],
"application": {
"user_id": "479c55b5-0731-4ad9-9012-a9e56f341338",
"status": "pending",
"contract": "uid"
}
},
{
"id": "12985",
"meta": {
"title": "Eco Friendly Stoves",
"createdAt": "2022-11-21T16:49:00.370Z",
"author": "479c55b5-0731-4ad9-9012-a9e56f341399",
"icon": "gas",
"location": {
"lat": "0.317714",
"long": "32.5813539",
"country": "Uganda",
"iso": "UGA"
},
"funding": {
"source": "ClimateGains",
"total": 1000,
"currency": "EUR",
"carbon": 250
}
}
},
{
"id": "12995",
"meta": {
"title": "Kenya Biogen",
"createdAt": "2022-11-21T16:49:00.370Z",
"author": "479c55b5-0731-4ad9-9012-a9e56f341399",
"icon": "leaf",
"location": {
"lat": "0.317714",
"long": "32.5813539",
"country": "Kenya",
"iso": "KEN"
},
"funding": {
"source": "ClimateGains",
"total": 1200,
"currency": "EUR",
"carbon": 150
}
}
},
{
"id": "139390",
"meta": {
"title": "Ndunga Village Hyacinth Farm",
"createdAt": "2022-11-11T16:49:00.370Z",
"author": "479c55b5-0731-4ad9-9012-a9e56f341399",
"icon": "leaf",
"location": {
"lat": "0.317714",
"long": "32.5813539",
"country": "Kenya",
"iso": "KEN"
},
"funding": {
"source": "ClimateGains",
"total": 1000,
"currency": "EUR",
"carbon": 150
}
}
}
]
}