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

JSON Query - Problem with PHP #1028

Open
Steema1 opened this issue Aug 14, 2019 · 1 comment

Comments

@Steema1
Copy link

commented Aug 14, 2019

We are writing a php procedure, to get objects information from the project loaded in bimserver.
For example we need to know all the doors and related guid, to extend the bim information.
Currently we are using api and we are able to call “getDataObjectByOid” and retrieve useful information calling server at “http://localhost/bimserver/json” url .
We have read, that the use of getDataObjectByOid is deprecated and it’s better to use query.
Unfortunately we are not be able to understand how to use the query method in a php procedure.

We have try with this php code, but the response is always empty:

$bimq = new stdClass();
$bimq->type = "IfcDoor";
$json_data = json_encode($bimq);
$post = file_get_contents('http://localhost/bimserver/json',null,stream_context_create(array(
'http' => array(
'protocol_version' => 1.1,
'user_agent' => 'PHPExample',
'method' => 'POST',
'header' => "Content-type: application/json\r\n".
"Connection: close\r\n" .
"Content-length: " . strlen($json_data) . "\r\n",
'content' => $json_data,
),
)));

Where we can find some indication about how to implement a query call?
Many thanks for your helps in advance.

@Steema1

This comment has been minimized.

Copy link
Author

commented Aug 19, 2019

Now i've seen that i've not specified the version. I tried to query bimserver version 1.5.162 . I apologize for the forgetfulness. Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.