{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"d8a829e3-22d4-4482-ae77-e5edaae6c321","name":"Snapbar Studio Admin API (Private BETA)","description":"Snapbar Studio is a service that allows clients to collect and maintain headshot photos for their employees, guests, or users. The Admin API uses [GraphQL](https://graphql.org/) for communicating with the service. **This documentation does not cover the full extent of API functionality**. Fetch the GraphQL schema via introspection (see below) for a full list of queries, objects, and mutations.\n\n# Overview\n\n## Endpoint\n\nEvery resource within the API is accessed through a single POST request to the following URL:\n\n`https://headshots.snapbar.com/api/v1/graphql`\n\n## Authentication and Authorization\n\nIn order to access the API you must first obtain an access token. This can be accomplished by reaching out to your Account Manager at Snapbar. They will properly configure access scopes for authorization needs. Requests are made using the `Authorization` header while passing along to the token as `Bearer`. Example:\n\n`Authorization: Bearer your-access-token`\n\n## Using GraphiQL\n\nThe easiest way to explore the API is through our GraphiQL interface hosted at [https://headshots.snapbar.com/graphiql](https://headshots.snapbar.com/graphiql). Note you'll need to authenticate with your Snapbar account and select an account before making queries.\n\n<img src=\"https://content.pstmn.io/00cf6166-6a39-4d97-a2f2-a68661e7d4fe/U2NyZWVuc2hvdCAyMDIzLTExLTI4IGF0IDExLjM1LjM44oCvQU0ucG5n\">\n\n## Introspection\n\nThe examples provided in this document do not include every accessible object within the API. For a complete list, the API supports standard GraphQL [introspection](https://graphql.org/learn/introspection/). We highly recommend syncing the schema into your tool of choice for exploring various queries and mutations, [which is supported](https://learning.postman.com/docs/sending-requests/graphql/graphql/#introspection-and-importing-graphql-schemas) by Postman.\n\n# Pagination\n\nA majority of the list type queries have the ability to paginate with a cursor-based Relay-style pagination system ([read more](https://relay.dev/graphql/connections.htm)). Those without the cursor argument output the full list of objects. A few of the list type queries also allow for sorting keys and sort direction. Those will be noted in the documentation for those queries.\n\n## Polling for changes\n\nAlthough it may be possible to filter by date, the more reliable way to poll for new nodes with a query is to use our cursor-based pagination method. You'll need a way to store the last processed cursor in some stateful store like a database or caching system. It's worth noting that cursors are not unique to the resource/node, but rather in relation to the query you've requested. In other words - if you change your query or sorting key by a non-stable field (e.g. `updatedAt`), the cursors for the resulting nodes are subject to change. It's best to sort by a key that isn't bound to change (e.g. `createdAt` or `submittedAt`).\n\nLet's look at an example to poll for newly accepted submissions.\n\nFirst, process all existing submissions:\n\n``` graphql\nquery {\n  submissions(first: 50, state: ACCEPTED, sortDirection: ASC, sortBy: SUBMITTED_AT) {\n    edges {\n      node {\n        id\n      }\n      cursor\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n\n ```\n\nExample response:\n\n``` json\n{\n  \"data\": {\n    \"submissions\": {\n      \"edges\": [\n        {\n          \"node\": {\n            \"id\": \"gid://holar/Submission/61983604ff402800015a8d9f\"\n          },\n          \"cursor\": \"MQ\"\n        },\n        ...\n        {\n          \"node\": {\n            \"id\": \"gid://holar/Submission/631f7bcb49dfcf00015ffb8e\"\n          },\n          \"cursor\": \"NTA\"\n        }\n      ],\n      \"pageInfo\": {\n        \"hasNextPage\": true,\n        \"endCursor\": \"NTA\"\n      }\n    }\n  }\n}\n\n ```\n\nStore the `endCursor` in a data store (e.g. database / cache) for future queries. Get the next page, sending the `after` variable based on the `endCursor` value:\n\n``` graphql\nquery {\n  submissions(after: \"NTA\", first: 50, state: ACCEPTED, sortDirection: ASC, sortBy: SUBMITTED_AT) {\n    edges {\n      node {\n        id\n      }\n      cursor\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n\n ```\n\nExample response:\n\n``` json\n{\n  \"data\": {\n    \"submissions\": {\n      \"edges\": [\n        {\n          \"node\": {\n            \"id\": \"gid://holar/Submission/631f7bcb49dfcf00015lfb72\"\n          },\n          \"cursor\": \"QzR\"\n        }\n      ],\n      \"pageInfo\": {\n        \"hasNextPage\": false,\n        \"endCursor\": \"QzR\"\n      }\n    }\n  }\n}\n\n ```\n\nSince `hasNextPage` is `false`, we know we've reached the end of the list. Continue polling (e.g. every hour/day) with `cursor` \"QzR\" until new results are found. When new submissions are accepted between polls, a new set of edges appear, resulting in a new `endCursor`. In this way we can process new submissions and avoid re-processing old ones.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"23704631","team":749490,"collectionId":"d8a829e3-22d4-4482-ae77-e5edaae6c321","publishedId":"2s93JzKfFn","public":true,"publicUrl":"https://headshots.snapbar.dev","privateUrl":"https://go.postman.co/documentation/23704631-d8a829e3-22d4-4482-ae77-e5edaae6c321","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2023-03-17T21:00:58.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/d77a124c19034cda9ec644649b4c383363a6ceb15f95fde89bedce7ca4c38006","favicon":"https://snapbar.dev/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://headshots.snapbar.dev/view/metadata/2s93JzKfFn"}