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

Using batch createObservations failed #1924

Closed
smilehappy126 opened this issue May 11, 2024 · 9 comments
Closed

Using batch createObservations failed #1924

smilehappy126 opened this issue May 11, 2024 · 9 comments

Comments

@smilehappy126
Copy link

Hi
I'm sending createObservations request to FROST-Server but keep receiving error message below:
{"code":400,"type":"error","message":"Missing required property 'result'"}
But it will works while I separate the array and send it one by one using /Observation.

Here's my request ↓
url: http://localhost:43795/FROST-Server/v1.1/Observations
data:
[ { "Datastream": { "@iot.id": 1 }, "components": [ "phenomenonTime", "result", "FeatureOfInterest/id" ], "dataArray": [ [ "2010-12-23T10:20:00-0700", 20, 1 ], [ "2010-12-21T10:21:00-0700", 30, 1 ] ] } ]

Am I missing something? Thanks!

p.s. Using FROST-Server in container from docker-image.

@hylkevds
Copy link
Member

You should be posting the DataArray to /v1.1/CreateObservations.

@smilehappy126
Copy link
Author

Yes. I sent it to /v1.1/CreateObservations but in vain.
I mean posting to /Observation one by one works well to proof the service is healthy.

@hylkevds
Copy link
Member

Hmm, testing with latest I did notice FROST is picky about the time zone formatting, it wants the : in there: 2010-12-21T10:21:00-07:00.
But after changing that it works. Which version are you using?

@smilehappy126
Copy link
Author

I'm using latest as well. Not sure how to check the corresponding version number. But the error log is not relevant to phenomenonTime but result

@hylkevds
Copy link
Member

The version number is in the logs.
And I need to be able to reproduce your error to be able to find the cause...

@smilehappy126
Copy link
Author

I see. FROST-Server.Core Version: v2.3.0-33-g48825bc.

@smilehappy126
Copy link
Author

If I add the : to phenomenonTime. It seems no error now.

@hylkevds
Copy link
Member

That's the same version I'm testing with...
It's very odd that you got the error about the result. Are you sure you received that error when POSTing to /v1.1/CreateObservations? I do get that error when posting to /v1.1/Observations.

@smilehappy126
Copy link
Author

Yep. But I can't reproduce as well. But adding : do solve the problem. Thanks!

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

2 participants