Hi there,I'm looking to get all the borehole locations across all of the projects we have on the OpenGround server/database into one big table (ideally CSV), reformat them to be in the same location schema/datum, and then replace/update the entries in the database that need changing.How am I able to retrieve all of the location entries in the database, and their particular fields (such as Northing, Easting, coordinate system label etc.) so I can run scripts on them locally to format them all into the same schema?I am currently using Postman and have been able to get the list of all projects so far. I would like to try to avoid setting up a loop where I retrieve each project's locations one-by-one and then collate them as I may have a VERY significant amount of projects. Is there a way to do it through the OpenGround application perhaps?Kind regards,Zak
Hi Zak, Ive been given the following information that should help:
The user needs to use the '/api/v1.0/data/query' endpoint and the request body is as follows.
{ "Projections": [ { "Group": "Project", "Header": "ProjectId" }, { "Group": "MapCoordinateSystem", "Header": "Name" }, { "Group": "LocationDetails", "Header": "LocationID" }, { "Group": "LocationDetails", "Header": "Easting" }, { "Group": "LocationDetails", "Header": "Northing" } ], "Group": "LocationDetails", "Projects": [ ], "Orderings": [ { "Group": "Project", "Header": "ProjectId", "Ascending": true }, { "Group": "LocationDetails", "Header": "LocationID", "Ascending": true } ]}
I hope this helps.
Thank you very much for looking into this and responding to my query. I've played around with the code you've provided and if I remove the sections in your code labelling specific projects it does seem to do a fetch all command, which means you've an appropriate solution to my current challenge. Thank you.I do have a follow up question if it is possible, is there any way to see what fields/columns exist for the group "LocationDetails"? That is, get a list of all the Headers, as I believe that unique Headers may have been created from our LocationDetails when we migrated our data to the Bentley servers. I can see in OpenGround some headers that don't appear in the list you have provided, but I have not had any luck including them in the list of Headers as I believe the strings do not match. I have tried variations of the strings.Regards,Zak
Hi Zak,
There are various endpoints for querying the headers, such as:
https://api.uksouth-sandbox.openground.bentley.com/swagger/ui/index#!/Configuration/Configuration_GetAllPropertiesForConfigurationPack
You can also see this info through the interface under System>Configuration Packs>Manage Model.