Query to find all commit details

Is there any api to get all commits details.

What details are you concerned with? Date, time, Source application. Sender?

query {
  stream (id: "$STREAM_ID") {
    commits {
      items {
        createdAt
        authorName
        branchName
	sourceApplication        
        message
      }
    }
  }
}
{
  "data": {
    "stream": {
      "commits": {
        "items": [
          {
            "createdAt": "2023-09-19T10:27:52.402Z",
            "authorName": "Jonathon Broughton",
            "branchName": "grids",
            "sourceApplication": "Revit2023",
            "message": "Sent 19 objects from Revit2023."
          },
          {
            "createdAt": "2023-09-08T10:02:40.357Z",
            "authorName": "Jonathon Broughton",
            "branchName": "snowdon electrical",
            "sourceApplication": "Revit2024",
            "message": "Sent 2581 objects from Revit2024."
          },
          {
            "createdAt": "2023-09-07T08:02:14.785Z",
            "authorName": "Jonathon Broughton",
            "branchName": "rac_basic/everything",
            "sourceApplication": "Revit2023",
            "message": "Sent 421 objects from Revit2023."
          },

I have api for this but I want image also .

Hi @Sachin_Kannaujiya,

When you’re requesting something, could you please provide as much detail as possible?
If you’ve already tried using an API that we’ve shared, let us know beforehand. And if there’s something specific that you’re looking for, like an image, please mention that as well. By doing this, you’ll save us both time and ensure that we’re not wasting each other’s time.

Thanks!

1 Like

Good to know - this is something that will be available using the newer graphql API; the same data is available as with the quest above, but it will be using the new vocabulary - notice Project in place of Stream and versions in place of commits, and branchName is not replaced with modelName, but the Model` object is returned.

The specific addition you’ll find helpful here is previewUrl. This isn’t populated immediately with an image simply because the preview service is asynchronous to the Publish action.

The self-documentation of the API is here: https://speckle.xyz/graphql for any other parameters you wish but didn’t yet ask for.

I’ll be publishing more on this as Frontend2 gathers pace, the API settles down, and we are closer to the transition, but the full API as we have it is available on all up-to-date Speckle Servers. As you are hosting your own, you must keep track.

  project(id: $STREAM_ID) {
    versions {
      items {
        createdAt
        message
        sourceApplication
        model {
          name
        }
        previewUrl
      }
    }
  }
}
{
  "data": {
    "project": {
      "versions": {
        "items": [
          {
            "createdAt": "2023-09-19T10:11:07.084Z",
            "message": "Pushed 1684 elements from TeklaStructures.",
            "sourceApplication": "TeklaStructures2023",
            "model": {
              "name": "sample office"
            },
            "previewUrl": "https://speckle.xyz/preview/bde6a66d7e/commits/b7001b797c"
          },
          {
            "createdAt": "2023-09-19T08:08:17.868Z",
            "message": "Pushed 123 elements from TeklaStructures.",
            "sourceApplication": "TeklaStructures2023",
            "model": {
              "name": "gebze stair"
            },
            "previewUrl": "https://speckle.xyz/preview/bde6a66d7e/commits/b8fd53605a"
          },