Open vermeulendivan opened 2 years ago
API End points to use:
Hi @mal147 Do you have an example of a payload used for rx-maps?
Hello @osundwajeff , RxMap_MPv5.postman_collection.json I have created this specific Postman collection to showcase you how to create a Rxmap.
After a selection of a base reference map (NDVI for example) and a number of zones by the user (the map id and the number of zones must be stored to be used on next request).
Create a Rx Map from zoned base reference map: `import requests import json
payload = json.dumps({ "name": "MyRx MPv5", "tags": [ "RX_MAP" ], "sourceMapId": "4FBOtVzFALrcVH2pZXFv6N", "zoneCount": "5" }) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkRDQjZGQ0NEM0MyMjI5QzdFRTk1QTZBOUJDQkRCRTI2RjMwNjg1ODRSUzI1NiIsInR5cCI6IkpXVCIsIng1dCI6IjNMYjh6VHdpS2NmdWxhYXB2TDItSnZNR2hZUSJ9.eyJuYmYiOjE3MzIyMTk5MTcsImV4cCI6MTczMjIyMzUxNywiaXNzIjoiaHR0cHM6Ly9pZGVudGl0eS5nZW9zeXMtbmEuY29tL3YyLjEiLCJhdWQiOiJodHRwczovL2lkZW50aXR5Lmdlb3N5cy1uYS5jb20vdjIuMS9yZXNvdXJjZXMiLCJjbGllbnRfaWQiOiJtYXBwcm9kdWN0X2FwaSIsInN1YiI6IjEwMDExMTIzNSIsImF1dGhfdGltZSI6MTczMjIxOTkxNywiaWRwIjoibG9jYWwiLCJnZW82X3N1YiI6IlFnSTZPcmJSakVzUmZpTlp0VlBwNCIsImlhdCI6MTczMjIxOTkxNywic2NvcGUiOlsib3BlbmlkIiwib2ZmbGluZV9hY2Nlc3MiXSwiYW1yIjpbInBhc3N3b3JkIl19.aaW4Zd2MPFAmwjvA6fGDLcqCl43mGNt5201ttjLxYrykHDJ6ftKXxj9-L0O_knjegayaxQGTubQBFSOjWNaBRvkWKIZJ4BHEY0TtYpVCD-EGGyuasEajMv_7UWgWiv0PY8c9FA1Gv6b15O3V0mRKosDSaUnBCLNqShMYqZpokckNJqDRiXrmHgac4Br0wQ5DUQ6HpxZ1iAjF1UhvTtM2sCGU1VymbV6DSK2QSNNF8b42SeLBeQyNNA54pcRf73gHzIT5EQ_edoot-yXfOCVrTwvnleicW9KPYjSmZC2h-ixJ4NAQXIgaOsc93sBvOOQXxKyPgsAhHkqzGfNVR0kWGw' }
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text) `
Attribute values to the Rx Map using the value defined by the user on the new window (2nd screenshot at the top of the ticket)
`import requests import json
url = "http://api.geosys-na.net/field-level-maps/v5/maps/CXPvlY6KMuDNUhXe2lYYT/rx-map"
payload = json.dumps([ { "op": "add", "path": "/parameters/zones/0/attributes/value", "value": "50" }, { "op": "add", "path": "/parameters/zones/1/attributes/value", "value": "60" }, { "op": "add", "path": "/parameters/zones/2/attributes/value", "value": "70" }, { "op": "add", "path": "/parameters/zones/3/attributes/value", "value": "80" }, { "op": "add", "path": "/parameters/zones/4/attributes/value", "value": "100" } ]) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkRDQjZGQ0NEM0MyMjI5QzdFRTk1QTZBOUJDQkRCRTI2RjMwNjg1ODRSUzI1NiIsInR5cCI6IkpXVCIsIng1dCI6IjNMYjh6VHdpS2NmdWxhYXB2TDItSnZNR2hZUSJ9.eyJuYmYiOjE3MzIyMTk5MTcsImV4cCI6MTczMjIyMzUxNywiaXNzIjoiaHR0cHM6Ly9pZGVudGl0eS5nZW9zeXMtbmEuY29tL3YyLjEiLCJhdWQiOiJodHRwczovL2lkZW50aXR5Lmdlb3N5cy1uYS5jb20vdjIuMS9yZXNvdXJjZXMiLCJjbGllbnRfaWQiOiJtYXBwcm9kdWN0X2FwaSIsInN1YiI6IjEwMDExMTIzNSIsImF1dGhfdGltZSI6MTczMjIxOTkxNywiaWRwIjoibG9jYWwiLCJnZW82X3N1YiI6IlFnSTZPcmJSakVzUmZpTlp0VlBwNCIsImlhdCI6MTczMjIxOTkxNywic2NvcGUiOlsib3BlbmlkIiwib2ZmbGluZV9hY2Nlc3MiXSwiYW1yIjpbInBhc3N3b3JkIl19.aaW4Zd2MPFAmwjvA6fGDLcqCl43mGNt5201ttjLxYrykHDJ6ftKXxj9-L0O_knjegayaxQGTubQBFSOjWNaBRvkWKIZJ4BHEY0TtYpVCD-EGGyuasEajMv_7UWgWiv0PY8c9FA1Gv6b15O3V0mRKosDSaUnBCLNqShMYqZpokckNJqDRiXrmHgac4Br0wQ5DUQ6HpxZ1iAjF1UhvTtM2sCGU1VymbV6DSK2QSNNF8b42SeLBeQyNNA54pcRf73gHzIT5EQ_edoot-yXfOCVrTwvnleicW9KPYjSmZC2h-ixJ4NAQXIgaOsc93sBvOOQXxKyPgsAhHkqzGfNVR0kWGw' }
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text) `
Then, deliver the RX map to the user
`import requests
url = "http://api.geosys-na.net/field-level-maps/v5/maps/CXPvlY6KMuDNUhXe2lYYT?directlinks=true"
payload = {} headers = { 'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkRDQjZGQ0NEM0MyMjI5QzdFRTk1QTZBOUJDQkRCRTI2RjMwNjg1ODRSUzI1NiIsInR5cCI6IkpXVCIsIng1dCI6IjNMYjh6VHdpS2NmdWxhYXB2TDItSnZNR2hZUSJ9.eyJuYmYiOjE3MzIyMTk5MTcsImV4cCI6MTczMjIyMzUxNywiaXNzIjoiaHR0cHM6Ly9pZGVudGl0eS5nZW9zeXMtbmEuY29tL3YyLjEiLCJhdWQiOiJodHRwczovL2lkZW50aXR5Lmdlb3N5cy1uYS5jb20vdjIuMS9yZXNvdXJjZXMiLCJjbGllbnRfaWQiOiJtYXBwcm9kdWN0X2FwaSIsInN1YiI6IjEwMDExMTIzNSIsImF1dGhfdGltZSI6MTczMjIxOTkxNywiaWRwIjoibG9jYWwiLCJnZW82X3N1YiI6IlFnSTZPcmJSakVzUmZpTlp0VlBwNCIsImlhdCI6MTczMjIxOTkxNywic2NvcGUiOlsib3BlbmlkIiwib2ZmbGluZV9hY2Nlc3MiXSwiYW1yIjpbInBhc3N3b3JkIl19.aaW4Zd2MPFAmwjvA6fGDLcqCl43mGNt5201ttjLxYrykHDJ6ftKXxj9-L0O_knjegayaxQGTubQBFSOjWNaBRvkWKIZJ4BHEY0TtYpVCD-EGGyuasEajMv_7UWgWiv0PY8c9FA1Gv6b15O3V0mRKosDSaUnBCLNqShMYqZpokckNJqDRiXrmHgac4Br0wQ5DUQ6HpxZ1iAjF1UhvTtM2sCGU1VymbV6DSK2QSNNF8b42SeLBeQyNNA54pcRf73gHzIT5EQ_edoot-yXfOCVrTwvnleicW9KPYjSmZC2h-ixJ4NAQXIgaOsc93sBvOOQXxKyPgsAhHkqzGfNVR0kWGw' }
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text) `
Please don't hesitate for any questions you have!
cc @mvmaltitz
Thanks @mal147, I'll go through it
The user should be allowed to create Rx maps. Quick summary:
Fetch RX map parameters for user:
New section for RX maps:
Two options on where to choose format:
API workflow: