I am trying to receive a list of commits from a given stream and visualize it in another web app called Rows. It supports HTTP requests. How can I make a GET request to Speckle server? Any advice would be much appreciated? (Not an expert in making HTTP Requests )
My suggestion would be to do that through our GraphQL API, which is a bit friendlier than normal REST API’s. Once you set up how to call the graphql endpoint, you can ask for any information from it.
Not to bore you with much of the details, but you can play around with the API directly on our explorer (Speckle GraphQL API) which deals with auth for you, or directly on the GraphQL UI (https://speckle.xyz/graphql) which requires you to pass in the auth headers yourself (this last one is a more similar scenario to what you’ll have to do)
Needless to say, all Speckle server’s have this feature, so if you’re using another server you can just replace the url for yours (https://YOURSPECKLE.SERVER/graphl)
And this would be using graphql variables to create a more “general” query that could be used for any stream. Notice the left-bottom corner Query Variables tab now has a JSON object defining the id we want to query.
thanks for taking your time to prepare the detailed answer. I have been playing with GraphQL explorer for some time now. It is indeed really fun and well documented😉. I was using speckle.xyz/explorer though.
I think you’ll understand what I mean when you watch the video down below. The tool has a built in GET, POST functions to make requests to the server. I think I need an API endpoint. Weather API’s endpoint as an example:
Oh interesting, it seems like you should use their post function (as all graphql interactions are actually post requests, even if you’re just getting data) so i think you want to be looking at this one instead Sending data to any API | Rows
This allows you to define the body and headers, which I think it’s all you need.
In the body you pass in the query and if necessary the variables, and that should do it!