Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify REST API GET and POST/PUT values #520

Open
kazlauskis opened this issue Jun 19, 2024 · 0 comments
Open

Unify REST API GET and POST/PUT values #520

kazlauskis opened this issue Jun 19, 2024 · 0 comments

Comments

@kazlauskis
Copy link
Member

The Warehouse REST API allows to create, fetch and update existing models, but the interface is slightly different. I want to be able to POST a new model (say a sample), then GET the values from the warehouse, and PUT updated values. The main issue is that term list values return labels rather than warehouse IDs, so I cannot PUT the values I received from the GET request.

POST

{
  "values": {
    "date": "19/06/2024",
    "entered_sref_system": 4326,
    "entered_sref": "54.8978567, 23.8933197",
    "smpAttr:922": 2398
  }
}

GET

{
  "values": {
    "date": "19/06/2024",
    "entered_sref_system": 4326,
    "entered_sref": "54.8978567, 23.8933197",
     "smpAttr:922": "iOS",
  }
}

PUT

{
  "values": {
    "date": "19/06/2024",
    "entered_sref_system": 4326,
    "entered_sref": "54.8978567, 23.8933197",
     "smpAttr:922": "iOS", <--- ERROR:  "Invalid value iOS for attribute Data Source"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant