{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"d10b88d4-4472-4099-80c3-152b27a22845","name":"3DiVi Face Machine Server API Documentation","description":"- [Testing 3DiVi FMS API](#testing-3divi-fms-api)\n- [Authentication](#authentication)\n- [Pagination](#pagination)\n- [Filtering](#filtering)\n- [Sorting](#sorting)\n- [List of Errors](#list-of-errors)\n- [API Reference](#api-reference)\n\nYou can perform all available operations with the [Face Machine Server objects](https://docs.facemachine.3divi.com/docs/fms_objects/) (such as [Person Profiles](https://docs.facemachine.3divi.com/docs/fms_objects/#person-profile), [Edge Devices](https://docs.facemachine.3divi.com/docs/fms_objects/#edge-device), [Lists](https://docs.facemachine.3divi.com/docs/fms_objects/#profile-group-list), etc.) using the **Face Machine Server API (FMS API)**.\n\nIn this documentation, you can find all sample FMS API requests and responses. Sample requests are available in several languages, including C#, HTTP, Java, Python, and others – see the tab *LANGUAGE* at the top of the page. All the programming languages that can execute API requests are supported by the FMS API.\n\nFMS API uses **GraphQL**. GraphQL is an open-source API data query and manipulation language and a runtime for running existing data queries. GraphQL supports reading, writing (mutating), and subscribing to data modifications. You can learn more about GraphQL from the following sources:\n\n* [Introduction to GraphQL](https://graphql.org/learn/)\n* [How to GraphQL](https://www.howtographql.com/)\n* [Guides and Best Practices](https://www.graphql.com/guides/)\n\n# Testing 3DiVi FMS API \n\nYou can find sample requests and responses in the folders below this section. You can easily test all the requests in GraphiQL or Postman. Choose the tool that you like more and follow the instructions below.\n\n## Testing in GraphiQL\n\n* Log in to your [personal Face Machine account](https://facemachine.3divi.com/). \n* Go to https://facemachine.3divi.com/graphiql/\n* Copy the request you'd like to test and paste it in the field on the left. Don't forget to specify the required arguments.\n* Click the \"Run\" button. You'll see the response in the right part of the page.\n\n## Testing in Postman \n\n* Log in to your [personal Face Machine account](https://facemachine.3divi.com/).\n* Click the \"Run in Postman\" button at the top of this page to import this collection and open it directly in your Postman app.\n* Choose the request that you'd like to test and specify the required arguments. \n* Click the \"Send\" button. You'll see the response in the \"Response\" field.\n\n\n# Authentication\n\nFor authorization, you have to pass an API access token in the HTTP header “Token”. Each client receives a unique client token from the provider of 3DiVi Face Machine Server. Your access token is displayed in your personal account: see the **API** section on a dashboard.\n\n<img src=\"https://3divi.com/FMimages/FMG_17.png\" width=\"350\" /> \n\n\n# Pagination \n\nPagination is a way to get a subset of items when querying collections. You can pass the optional arguments `offset` and `limit` to the queries, which return collections of items (see the queries [Get info about Person Profiles](https://apidocs.facemachine.3divi.com/#d378d226-7eae-4979-9590-e82c945b8ceb), [Get info about Edge Devices](https://apidocs.facemachine.3divi.com/#c086ed93-a7a0-4fcc-80ba-cce1d54ca197), etc.): \n\n- `offset`: offset from the beginning of the list (integer)\n- `limit`: number of displayed objects in the output (integer)\n\nExample:\n```\nquery {\n  devices(limit: 20, offset: 10) {\n    collectionItems {\n      ...\n      }\n   }\n}\n```\n\nTotal number of items in the collection is returned in the `totalCount` field, collection items are returned in the `collectionItems` field.\n\nExample: \n\n```\nquery { \n  profiles { \n    totalCount\n  }\n}\n```\n\n# Filtering \n\nYou can use filtering to get the data that satisfies certain conditions, for example, if you want to see only people of certain age. Filtering conditions are passed in the `filter` variable as a JSON string. You should specify the object field and lookup operator for filtering. A nested object is indicated by double underscore (\"__\"). If there are multiple conditions, use the \"and\" operator to display the objects that satisfy all given conditions and the \"or\" operator to display the objects that satisfy at least one of the given conditions. To specify the data, use the comparison operators:\n\n- eq (\"equal to\", \"=\")\n- gte (\"greater than or equal to\", \">=\")\n- gt (\"greater than\", \">\")\n- lt (\"less than\", \"<\")\n- lte (\"less than or equal to\", \"<=\")\n- in (\"used to check if a value exists in a sequence or not\")\n\nIf the operator isn't set, the `eq` operator is used by default.\n\nThe example below demonstrates the filtering of persons by gender and age: only males \"less than or equal to 22\" or \"greater than or equal to 50\" years old are displayed.\n\n```\n{\n  \"and\": {\n    \"personInfo__gender\": \"Male\",\n    \"or\": [\n        {\"personInfo__age__lte\": 22},\n        {\"personInfo__age__gte\": 50}\n    ]\n  }\n}\n```\n\nSee the sample filtering request and response: [Filter Events](https://apidocs.facemachine.3divi.com/#e2ee688a-d839-4728-9b65-b86ebea42d38). \n\n# Sorting\n\nYou can use sorting to arrange items systematically, for example, to sort people by their names. To get the data ordered by a specific field, pass the name of the field to the `order` parameter. A nested object is indicated by double underscore (\"__\"). To sort the objects in the descending order, specify \"-\" in front of the object.\n\nThe example below demonstrates the sorting of Person Profiles by name (in the ascending order) and by age (in the descending order).\n\n```\n[\n  \"personInfo__name\",\n  \"-personInfo__age\"\n]\n```\n\nSee the sample sorting requests and responses: [Sort Person Profiles](https://apidocs.facemachine.3divi.com/#62452884-6591-4017-be8a-9fbc116f85c3) and [Sort Events](https://apidocs.facemachine.3divi.com/#59873412-f4d0-4a86-a62b-ba41e77f0602).\n\n\n# List of Errors\n\nThe error **\"Wrong token\"** means that you didn't pass any client token or the token is incorrect (see the section [Authentication](#authentication)).\n\nSample output for this error: \n```\n{\n  \"errors\": [\n    {\n      \"message\": \"[{'message': 'Wrong token', 'locations': [{'line': 1, 'column': 2}], 'path': ['permissions'], 'error_code': 2}]\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"devices\"\n      ]\n    }\n  ],\n  \"data\": {\n    \"devices\": null\n  }\n}\n```\n\nThe error **\"Could not identify (or identify more than 1) face from this sample\"** means that the uploaded picture is invalid, for example:\n\n  - the image resolution is too low or too high\n  - there are more than one person in the pucture\n  - there are no faces in the image\n\nSample output for this error:\n```\n{\n  \"errors\": [\n    {\n      \"message\": \"[{'message': 'Could not identify (or identify more than 1) face from this sample (face count = 0', 'locations': [{'line': 3, 'column': 21}], 'path': ['faces']}]\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createProfile\"\n      ]\n    }\n  ],\n  \"data\": {\n    \"createProfile\": null\n  }\n}\n```\n\nThe error **\"Expecting value: line 1 column 1 (char 0)\"** means that the requested info was not found in the Face Machine Client. \n\nSample output for this error:\n```\n{\n  \"errors\": [\n    {\n      \"message\": \"Expecting value: line 1 column 1 (char 0)\"\n    }\n  ]\n}\n```\n\nThe error **\"Variable \\\"$groupId\\\" of required type \\\"ID!\\\" was not provided\"** means that required fields (in this case, it's `groupId`) weren't passed in the request. \n\nSample output for this error:\n```\n{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$groupId\\\" of required type \\\"ID!\\\" was not provided.\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 10\n        }\n      ]\n    }\n  ]\n}\n```\n\n# API Reference\n\nBelow you can find the examples of the Face Machine Server API requests and responses. ","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"8918561","team":562567,"collectionId":"d10b88d4-4472-4099-80c3-152b27a22845","publishedId":"SW7aWn8r","public":true,"publicUrl":"https://apidocs.facemachine.3divi.com","privateUrl":"https://go.postman.co/documentation/8918561-d10b88d4-4472-4099-80c3-152b27a22845","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2021-04-26T11:20:17.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/1590ffa184d06c4602c30ea086496b80702d5cda6e25e13bc499215d95e23522","favicon":"https://res.cloudinary.com/postman/image/upload/v1575534021/team/ipqaz8etp3ksk4rcilhg.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://apidocs.facemachine.3divi.com/view/metadata/SW7aWn8r"}