{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"b9f6a134-fc53-409d-81a7-3e0644ae254a","name":"SalesCandy Graph API","description":"# Overview\n\nSalesCandy's Graph API will allow you to query your data in SalesCandy using programmatic API integrations with your reporting, BI, or CRM systems. \n\nUsing the API you can perform the following use cases, and more:\n\n- Query and browse the data on SalesCandy.\nNow you can use your favorite BI tools like Microsoft Power BI or Tableau to analyze your data on SalesCandy. You can access raw data of your account, projects, lead sources, salespersons, leads, etc on SalesCandy.\n\n- Use it together with the _SalesCandy CandySync Webhook_, to sync your data from SalesCandy to your CRM system in real-time.\n\n    - All lead info.\n    - All updates are tracked in the action logs.\n\n- Sync changes from your CRM system with SalesCandy with incoming webhooks;\n\n    - When salespersons change lead status on the CRM system.\n    - When won details are updated on the CRM system in SalesCandy's format.\n\n# Using GraphQL\n\nSalesCandy's Graph API is implemented using GraphQL.\n\nGraphQL is a data query language and specification developed internally by Facebook in 2012 before being publicly open sourced in 2015. It provides an alternative to REST-based architectures with the purpose of increasing developer productivity and minimizing amounts of data transferred.\n\nIt provides clients, the ability to query an object graph (a hierarchical structure of related objects). Using GraphQL, clients also get to choose what fields need to be included in the response.\n\nOther than that, GraphQL is pretty much self explanatory. It is predetermined whether a query is valid or not, without having to rely on runtime checks.\n\n## References\n1. https://graphql.org/learn/\n1. https://www.howtographql.com/\n1. https://medium.com/open-graphql/graphql-1-140fab436942\n\n# Getting Started - Postman Collection\n\nThe easiest way to get started with the API is to click the [_Run in Postman_](https://www.getpostman.com/docs/run_button_ux) button present at the top of the documentation page and use the Postman App to send requests.\n\n## Variables\n\n| variable | value\n|---|----|\n|  url | https://graph.v3.salescandy.com\n|  token | GET FROM MANAGER PORTAL\n\n# Authentication\n\nA JWT web token are required to be sent as part of every request to the CRM API, in the form `jwttoken` in the request header.\n\nIf you do not have the token, you can easily generate one by heading over to the manager portal, and finding it in the Management > Integrations > Graph API section.\n\n![Management > Integrations > Graph API](https://support.salescandy.com/hc/article_attachments/360071240051/Screenshot_2020-10-01_at_10.28.12_AM.png)\n\nYou may create a token which has read-only or both read-and-write permissions to access the Graph API, depending on your use-case.\n\n## Example headers\n\nWhen you make requests, the `jwttoken` must be provided in the request header as shown below:\n\n```\njwttoken: eyJhbGciO__REDACTED__DP6iKJ4\nContent-Type: application/json\nUser-Agent: PostmanRuntime/7.28.4\nAccept: */*\nCache-Control: no-cache\nPostman-Token: 5cd1be21-6738-4d64-b816-141f743f5923\nHost: graph.v3.salescandy.com\nAccept-Encoding: gzip, deflate, br\nConnection: keep-alive\n```\n\n## Authentication related error response\n\nIf an JWT token is missing, malformed, or invalid, you will receive a `401 Unauthorised` response code and the following JSON response:\n\n```\n{\n  \"errors\": [\n    {\n      \"errorType\": \"UnauthorizedException\",\n      \"message\": \"You are not authorized to make this call.\"\n    }\n  ]\n}\n```\n\n**Note:** Previous versions of this document refers to an API key which should be supplied with the `x-api-key` header. We no longer require this header, and it is ignored in existing integrations.\n\n# Support\n\nFor help regarding accessing the API, feel free to drop in a line at [help@salescandy.com](mailto:help@salescandy.com).\n\nIn the event you receive a `503` response from our servers, it implies that we have hit an unexpected spike in API access traffic and would usually be operational within the next 24 hours. If the outage persists, or your receive any other form of `5XX` error, kindly let us know.\n\n\n# Terms of Use\n\nFor information on API terms of use and privacy, refer to our policy document at [https://www.salescandy.com/legal/eutos](https://www.salescandy.com/legal/eutos)\n\n> SalesCandy is not liable for any fault in the API or any harm that may result from its use; Developer is solely responsible for any liability which may arise from a Merchant’s access to or use of the API.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"3992819","team":234955,"collectionId":"b9f6a134-fc53-409d-81a7-3e0644ae254a","publishedId":"UVC5G86U","public":true,"publicUrl":"https://docs.graph.salescandy.com","privateUrl":"https://go.postman.co/documentation/3992819-b9f6a134-fc53-409d-81a7-3e0644ae254a","customColor":{"top-bar":"FFFFFF","right-sidebar":"551d75","highlight":"8B1C5D"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2021-11-10T07:02:07.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/1a1e38d2c558578e1f3644c5c1fb5a44d8e035865b9cada8a04658165603153b","favicon":"https://salescandy.com/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://docs.graph.salescandy.com/view/metadata/UVC5G86U"}