{"swagger":"2.0","info":{"title":"Mopinion data API","description":"\n # Introduction\nWelcome to the Mopinion API documentation. Here you will find a detailed guide on how to access your customer\u0027s feedback through our RESTful API.\n\n## Endpoint\n\nThe API can be reached at \u003Ca href=\u0022https:\/\/api.mopinion.com\u0022\u003E\u003Ci class=\u0022fa fa-external-link\u0022\u003E\u003C\/i\u003E https:\/\/api.mopinion.com\u003C\/a\u003E.\n\n## Credentials\nCredentials can be created via the Mopinion Suite at Settings \u0026raquo; Feedback Api in classic interface or Integrations \u0026raquo; Feedback API in Raspberry interface, provided your package includes API access.\u003Cbr\u003E\n\nEach credential set consist of 3 parts:\u003Cbr\u003E\n| Name          | Description   |\n|---            |---            |\n| public key    | The ID for the application communicating with the API |\n| private key   | used for obtainting the signature-token via the API |\n| signature token | Use the signature token to \u003Ca href=\u0022#section\/Authentication\/Creating-an-authentication-token\u0022\u003Ecreate an encrypted authentication token\u003C\/a\u003E\u003Cbr\u003E\u003Csmall\u003E The signature token can also be \u003Ca href=\u0022#section\/Authentication\/Obtaining-the-signature-token-via-the-API\u0022\u003Eretrieved via the API\u003C\/a\u003E\u003C\/small\u003E|\n\u003Cbr\u003E\nPlease note it\u0027s important to keep the \u003Cstrong\u003Eprivate key\u003C\/strong\u003E and \u003Cstrong\u003Esignature token\u003C\/strong\u003E secret. They should not be included in any publicly accessible code (ie client-side code, public VCS repositories etc). This is also true for any Base64-encoded hashed versions of the credentials.\n\n# Versioning\nWe strive to follow \u003Ci\u003ESemantic Versioning\u003C\/i\u003E. For more information go to \u003Ca href=\u0022http:\/\/semver.org\/\u0022 target=\u0022_blank\u0022\u003E\u003Ci class=\u0022fa fa-external-link\u0022\u003E\u003C\/i\u003E http:\/\/semver.org\u003C\/a\u003E.\n\n\u003Cstrong\u003ETL;DR\u003C\/strong\u003E\u003Cbr\u003E\nVersion numbers follow a MAJOR.MINOR.PATCH format, which basically comes down to this:\u003Cbr\u003E\n\n| Version   | Description |\n|---        |--- |\n| MAJOR     |  Introduces incompatible changes |\n| MINOR     |  Adds or changes functionality \/ properties in a backwards-compatible manner |\n| PATCH     |  Backwards-compatible bug fixes \u003Cbr\u003E\u003Csmall\u003EThe \u0027PATCH\u0027 version number is generally not used to determine which version of the API is served, just use \u003Ccode\u003E0\u003C\/code\u003E\u003C\/small\u003E |\n\u003Cbr\u003E\nA specific version can be forced by using a \u003Ccode\u003Eversion\u003C\/code\u003E-header, and we recommend you to do so, to ensure response consistenty. If no \u003Ccode\u003Eversion\u003C\/code\u003E-header is provided, the latest stable version of the API will be used.\n\n# Authentication\n\nAll requests to the API must be signed with an authentication token, sent via a \u003Ccode\u003Ex-auth-token\u003C\/code\u003E header.\u003Cbr\u003E\n\u003Csmall\u003E(with the exception of the \u003Ccode\u003E\/ping\u003C\/code\u003E and \u003Ccode\u003E\/token\u003C\/code\u003E endpoints).\u003C\/small\u003E\n\n## Creating an authentication token\n\nThe authentication token is a \u003Ca href=\u0022https:\/\/en.wikipedia.org\/wiki\/Base64\u0022 target=\u0022_blank\u0022\u003E\u003Ci class=\u0022fa fa-external-link\u0022\u003E\u003C\/i\u003E Base64\u003C\/a\u003E encoded string, consisting of your \u003Cstrong\u003Epublic key\u003C\/strong\u003E, paired with an \u003Ca href=\u0022https:\/\/en.wikipedia.org\/wiki\/Hash-based_message_authentication_code\u0022 target=\u0022_blank\u0022\u003E\u003Ci class=\u0022fa fa-external-link\u0022\u003E\u003C\/i\u003E HMAC\u003C\/a\u003E-signature.\nThe HMAC-signature is unique for each request and must be created following the pattern below.\u003Cbr\u003E\n\u003Csmall\u003E(spaces added for readability)\u003C\/small\u003E\n\n\u003Cpre\u003EBASE64( PUBLIC_KEY : HMAC.SHA256( RESOURCE_URI | JSON_BODY )\u003C\/pre\u003E\n\nwhere:\n\n* RESOURCE_URI is the URI of the resource the request will be sent to, e.g. \u003Ccode\u003E\/reports\/1\u003C\/code\u003E\n* JSON_BODY is the requests body as a JSON string. \u003Cbr\u003E\u003Csmall\u003E(For requests without a body, like \u003Ccode\u003EGET\u003C\/code\u003E, JSON_BODY is an empty string).\u003C\/small\u003E\n\nAlso note that,\n\n* the PUBLIC_KEY and the HMAC-hash are separated by a single colon (\u003Ccode\u003E:\u003C\/code\u003E)\n* the RESOURCE_URI and JSON_BODY are seperated by a single pipe (\u003Ccode\u003E|\u003C\/code\u003E)\n* RESOURCE_URI  must start with a forward slash (\u003Ccode\u003E\/\u003C\/code\u003E), and must not include any query parameters, e.g.\u003Ccode\u003E?limit=50\u003C\/code\u003E.\n* the HMAC signature must be created using SHA256-hashing, and encrypted with your \u003Cstrong\u003Esignature token\u003C\/strong\u003E.\n\u003Cbr\u003E\n### Example\nLet\u0027s assume we have a public key \u003Ccode\u003E123abc\u003C\/code\u003E, a signature token \u003Ccode\u003E$1gn47ur3T0k3n\u003C\/code\u003E, and we want to add a report by making a \u003Ccode\u003EPOST\u003C\/code\u003E request to the \u003Ccode\u003E\/reports\u003C\/code\u003E URI. For the request body we use\n\u003Cpre\u003E\n\u003Ccode class=\u0022language-json\u0022\u003E{\n    \u0022name\u0022:\u0022My new report\u0022,\n    \u0022language\u0022:\u0022en\u0022\n}\u003C\/code\u003E\n\u003C\/pre\u003E\n\nThe HMAC-signature will be: \u003Cbr\u003E\n\u003Cpre\u003E8d0d693f34c58c60fc46cf3a725642dc5a43594bcc8be2537e81c904ee4dc2c1\u003C\/pre\u003E\nand the final \u003Ccode\u003Ex-auth-token\u003C\/code\u003E will be:\n\u003Cpre\u003EMTIzYWJjOjhkMGQ2OTNmMzRjNThjNjBmYzQ2Y2YzYTcyNTY0MmRjNWE0MzU5NGJjYzhiZTI1MzdlODFjOTA0ZWU0ZGMyYzE=\u003C\/pre\u003E\n\n\n## Credential Checker\n\nYou can use our \u003Ca href=\u0022\/credential-checker.php\u0022\u003ECredential Checker\u003C\/a\u003E to verify if your code for generating the \u003Ccode\u003Ex-auth-token\u003C\/code\u003E is correct.\n\n\n## Obtaining the signature token via the API\n\nMake a \u003Ccode\u003EGET\u003C\/code\u003E request to the \u003Ccode\u003E\/token\u003C\/code\u003E endpoint, using your \u003Cstrong\u003Epublic_key\u003C\/strong\u003E and \u003Cstrong\u003Eprivate_key\u003C\/strong\u003E to create an \u003Ccode\u003EAuthorization\u003C\/code\u003E header (\u003Ca href=\u0022https:\/\/tools.ietf.org\/html\/rfc1945#section-11.1\u0022 target=\u0022_blank\u0022\u003E\u003Ci class=\u0022fa fa-external-link\u0022\u003E\u003C\/i\u003E RFC1945 -11.1 Basic Authentication Scheme\u003C\/a\u003E )\n\u003Cbr\u003E\n\u003Cbr\u003E\nThe API will return a JSON response containing the token.\n\n\u003Cpre\u003E\n\u003Ccode class=\u0022language-json\u0022\u003E{\n    \u0022token\u0022:\u0022$1gn47ur3T0k3n\u0022\n}\u003C\/code\u003E\n\u003C\/pre\u003E\n\n# Requests and Responses\n\n## URL structure\nRequests to the API follow this stucture:\n\n\u003Cpre\u003E\nhttps:\/\/api.mopinion.com\/{resource-name}[\/{resource-id}[\/{sub-resource-name}]][?parameters]\n\u003C\/pre\u003E\n\n\n| Field     | Type  | Description   |\n| ---       | ---   | ---           |\n| (sub)-resource-name | String| The name of the resource (collection) |\n| resource-id | Integer, String | The id of the resource(s) \u003Cbr\u003E \u003Csmall\u003EMostly this will be an integer, but in for some resources (like deployment keys) it can also be string. Some endpoints allow requesting multiple resources by comma-seperating id\u0027s\u003C\/small\u003E |\n| parameters | String | URL-query parameters \u003Cbr\u003E\u003Csmall\u003EQuery parameters can be used to fine-tune the request by adding \u003Ca href=\u0022#section\/Requests-and-Responses\/Filters\u0022\u003Efilters\u003C\/a\u003E and\/or \u003Ca href=\u0022#section\/Requests-and-Responses\/Pagination\u0022\u003Epagination\u003C\/a\u003E\u003C\/small\u003E|\n\n## Request methods\nThe API currently accepts the following request methods:\n\n| Method    | Description   |\n| ---       | ---           |\n| GET       | Retrieve a resource (collection) |\n|OPTIONS   | Request available methods for the resource\u003Cbr\u003E\u003Csmall\u003EThis will return with a \u003Ccode\u003E204\u003C\/code\u003E status code and no response body. Check the \u003Ccode\u003EAllow\u003C\/code\u003E response header for available methods\u003Csmall\u003E|\n\n## Request headers\n\n| Name          | Description   |\n|---            | ---           |\n| x-auth-token  | Required for most requests. See the topic on \u003Ca href=\u0022#section\/Authentication\u0022\u003EAuthentication\u003C\/a\u003E on how to create tokens |\n| version       | Optional, but recommended. If this is  not specified, all requests will default to the latest stable release|\n| verbosity     | Optional. Possible value are: \u003Ccode\u003Equiet\u003C\/code\u003E, \u003Ccode\u003Enormal\u003C\/code\u003Eand \u003Ccode\u003Efull\u003C\/code\u003E, defaults to \u003Ccode\u003Enormal\u003C\/code\u003E |\n\n### Verbosity levels\n* \u003Cstrong\u003Equiet\u003C\/strong\u003E: Returns a minimal response. Doesn\u0027t include response metadata.\u003Cbr\u003E\n* \u003Cstrong\u003Enormal\u003C\/strong\u003E: Default response \u003Cbr\u003E\n* \u003Cstrong\u003Efull\u003C\/strong\u003E:  Enables \u003Ca href=\u0022#section\/Requests-and-Responses\/HATEOAS\u0022\u003EHATEOS\u003C\/a\u003E based responses. It also wraps resources in a \u003Ccode\u003Edata\u003C\/code\u003E property, and adds some additonal data about the resource next to it.\n\n\u003E These headers will not be mentioned again under the \u003Ci\u003EParameters\u003C\/i\u003E section of the resources.\u003Cbr\u003E\n\u003E Also, for the sake of brevity, the headers in the documentations\u0027 code samples, have been kept to a minimum.\n\n\n## Content negotiation\n\nYou can use \u003Ca href=\u0022https:\/\/en.wikipedia.org\/wiki\/Content_negotiation\u0022 target=\u0022_blank\u0022\u003E\u003Ci class=\u0022fa fa-external-link\u0022\u003E\u003C\/i\u003E content negotiation\u003C\/a\u003E to request a specific content type in the response. This is achieved through the \u003Ccode\u003EAccept\u003C\/code\u003E header.\n\nBy default the API returns JSON responses, but we also allow you to return responses as YAML. To receive YAML, use \u003Ccode\u003Eapplication\/yaml\u003C\/code\u003E for the value of the \u003Ccode\u003EAccept\u003C\/code\u003E header.\nExamine the  \u003Cstrong\u003EContent-Type\u003C\/strong\u003E response header to see which content type was actually returned.\n\n\u003E \u003Ca href=\u0022#section\/Errors\u0022\u003EError responses\u003C\/a\u003E are \u003Cstrong\u003Ealways\u003C\/strong\u003E returned as JSON, regardless of the  requested content type.\n\n### No XML?\nThe API currently does not support XML responses, and it\u0027s not likely it will in the future. XML is ugly and inefficient (for transferring data), and it\u0027s not that hard to convert to it from JSON.\n\n## Metadata\n\nUnless you are sending a \u003Ccode\u003Everbosity:quiet\u003C\/code\u003E header along with a request, the body of a (successfull) response will include a \u003Ccode\u003E_meta\u003C\/code\u003E object.\nThis object contains information about the request\u0027s result, and may include any of the following properties.\n\n| Property  | Type      |Description        |\n|---        |---        |---                |\n| code      | Integer   | HTTP status code  |\n| message   | String    | Human readable message about the result \u003Cbr\u003E \u003Csmall\u003ETypically this contains the HTTP status message, but in some cases it may be different\u003C\/small\u003E\n| has_more  | Boolean   | Whether or not there are more results available |\n| previous  | String\/Boolean   | URI to retrieve the previous set of paged result or \u003Ccode\u003Efalse\u003C\/code\u003E if there is none  |\n| next      | String\/Boolean   | URI to retrieve the next set of paged results or \u003Ccode\u003Efalse\u003C\/code\u003E if there is none |\n| count     | Integer   | Number of returned results     |\n| total     | Integer   | Total number of items in the result set        |\n| warnings  | List      | A list of warning messages \u003Cbr\u003E\u003Csmall\u003EThis can include anything, from ignored properties in the request body to deprecation messages \u003C\/small\u003E |\n| changed   | Integer   | Number of properties changed\u003Cbr\u003E\u003Csmall\u003EPUT requests only\u003C\/small\u003E\n| previous_attributes | Object | Contains the changed properties and their previous value\u003Cbr\u003E\u003Csmall\u003EPUT requests only\u003C\/small\u003E|\n\n## Filters\nSome requests will allow you to fine-tune the request by using a filter url-query. Filters must have the following structure:\n\n\u003Cpre\u003E\n\u0026filter[{modifier}{key}]={value}\n\u003C\/pre\u003E\n\nFor example, to return only items with an NPS value of 5 or lower, you would use the following query:\n\u003Cpre\u003E\n\u0026filter[\u0026lt;\u0026lt;nps]=5\n\u003C\/pre\u003E\n\n\n| Parameter     | Description   |\n|---            |---            |\n| modifier      | (Optional) Changes the behavior of the filter |\n| key           | The type of filter                |\n| value         | The value to use for the filter   |\n\n\n### Filter keys\n\nCurrently, the following filters are available\n\n| Name          | Description   | Value |\n|---            |---            |---    |\n| date          |  Date | format: \u003Ccode\u003EYYYY-MM[-DD]\u003C\/code\u003E |\n| rating        |  General numeric rating | [number] |\n| nps           |  Net Promoter Score   | 0-10 |\n| ces           |  Customer Effort Score | 1-5 |\n| ces_inverse   |  Customer Effort Score (inverted) | 5-1 |\n| gcr           |  Goal Completion Rate | options:\u003Ccode\u003Eno\u003C\/code\u003E, \u003Ccode\u003Epartly\u003C\/code\u003E, \u003Ccode\u003Eyes\u003C\/code\u003E |\n| tags          |  Tags assigned to the feedback item(s)  | [string] \u003Cbr\u003E\u003Csmall\u003EUse \u003Ccode\u003E*\u003C\/code\u003E to filter for items containing any tag, or combine this with the\u003Ccode\u003E!\u003C\/code\u003E modifier to get only items with no tags\u003C\/small\u003E |\n\n\n### Modifiers\n\nModifiers can be applied to the filter keys as a prefix, and allow you to exclude or include values.\n\n\u003C!--\n\u003Cstrong\u003E Key modifiers \u003C\/strong\u003E\u003Cbr\u003E\nKey modifiers are applied to the filter keys, and allow you to exclude or include values.\n--\u003E\n\n| Modifier  | Function      | Description   |\n|---        |---            |---            |\n| !         |  Logical NOT  | Exclude the value from the result set |\n| \u003C         |  less than    | Include response-values below the filter-value|\n| \u003C\u003C        |  less than or equal   | Include response-values below or equal to the filter-value|\n| \u003E         |  greater than | Include response-values above the filter-value|\n| \u003E\u003E        |  greater than or equal| Include response-values above or equal to the filter-value|\n\n\u003E \u003Cstrong\u003EImportant!\u003C\/strong\u003E Not all modifiers can be applied to all filters, in which case that particular filter will be ignored. You can check the response\u0027s \u003Ccode\u003E\u003Ca href=\u0022#section\/Requests-and-Responses\/Metadata\u0022\u003E_meta\u003C\/a\u003E\u003C\/code\u003E property for warnings to see if any filters were ignored.\n\n\u003E \u003Cstrong\u003ETip!\u003C\/strong\u003E For the \u003Ccode\u003Edate\u003C\/code\u003E filter, instead of using a modifier, you could also use \u003Ccode\u003Edate_to\u003C\/code\u003E and \u003Ccode\u003Edate_from\u003C\/code\u003E as key.\n\n\n\u003C!--\n\u003Cstrong\u003E Value modifiers \u003C\/strong\u003E\u003Cbr\u003E\nValue modifiers are applied to the filter values, and allow you to specify a selection or range\n--\u003E\n\n## Pagination\nSome requests will allow you to paginate their response by adding query parameters to the URL. The following parameters are available:\n\n| Parameter | Type      | Description   |\n|---        |---        |---            |\n| limit     | Integer   | Maximum number of items to return. Defaults to \u003Ccode\u003E10\u003C\/code\u003E |\n| page      | Integer   | Page number.  defaults to \u003Ccode\u003E1\u003C\/code\u003E|\n| sort      | String    | Possible value are \u003Ccode\u003Ecreated\u003C\/code\u003E and \u003Ccode\u003Edatetime\u003C\/code\u003E          |\n| order     | String    | Possible value are \u003Ccode\u003Easc\u003C\/code\u003E and \u003Ccode\u003Edesc\u003C\/code\u003E. Defaults to \u003Ccode\u003Edesc\u003C\/code\u003E |\n\n\u003Cbr\u003E\nFrom the response you can use the \u003Ccode\u003E\u003Ca href=\u0022#section\/Requests-and-Responses\/Metadata\u0022\u003E_meta\u003C\/a\u003E\u003C\/code\u003E property for pagination. The  \u003Ccode\u003Ehas_more\u003C\/code\u003E, \u003Ccode\u003Ecount\u003C\/code\u003E and \u003Ccode\u003Etotal\u003C\/code\u003E properties, give a quick overview of returned and total results. And the \u003Ccode\u003Eprevious\u003C\/code\u003E\/\u003Ccode\u003Enext\u003C\/code\u003E properties, if available, allow you to quickly navigate through the result set, while keeping filters and sorting intact.\n\n\n## HATEOAS\nAnother hot buzzword for you.\n\u003Ca href=\u0022https:\/\/en.wikipedia.org\/wiki\/HATEOAS\u0022 target=\u0022_blank\u0022 \/\u003E\u003Ci class=\u0022fa fa-external-link\u0022\u003E\u003C\/i\u003E This is what Wikipedia says\u003C\/a\u003E.\n\u003Cbr\u003E\n\u003Cbr\u003E\n\u003Cstrong\u003ETL;DR\u003C\/strong\u003E\u003Cbr\u003E\nIn the response body, you\u0027ll find a \u003Ccode\u003E_links\u003C\/code\u003E property under each resource, which includes a list of URI\u0027s that can be used for follow-up requests, if available.\u003Cbr\u003E\nBy default this is disabled. If you need HATEOS add a \u003Ccode\u003Everbosity:full\u003C\/code\u003E header.\n\n\u003Cpre\u003E\n    _links: [\n        {\n            \u0022rel\u0022: \u0022self\u0022,\n            \u0022uri\u0022: \u0022reports\/1\u0022\n        },\n        {\n            \u0022rel\u0022: \u0022reports.feedback\u0022,\n            \u0022uri\u0022: \u0022reports\/1\/feedback\u0022\n        },\n        {\n            \u0022rel\u0022: \u0022reports.fields\u0022,\n            \u0022uri\u0022: \u0022reports\/1\/fields\u0022\n        }\n    ]\n\u003C\/pre\u003E\n\n\n\u003Ccode\u003EPOST\u003C\/code\u003E requests also return the URI of the created resource via the \u003Ccode\u003ELocation\u003C\/code\u003E header.\n\n# Errors\nSometimes things don\u0027t go as expected. In case an error happens, the API will try to return an error based on the \u003Cstrong\u003EApplication Problem\u003C\/strong\u003E specification (\u003Ca href=\u0022https:\/\/tools.ietf.org\/html\/rfc7807\u0022 target=\u0022_blank\u0022\u003E\u003Ci class=\u0022fa fa-external-link\u0022\u003E\u003C\/i\u003E RFC7807\u003C\/a\u003E)\n\u003Cbr\u003E\n\u003Cbr\u003E\n\u003Cstrong\u003ETL;DR\u003C\/strong\u003E\u003Cbr\u003E\nThe response body for errors is \u003Ci\u003Ealways\u003C\/i\u003E JSON, and the \u003Cstrong\u003EContent-Type\u003C\/strong\u003E header of the response will be \u003Ccode\u003Eapplication\/problem+json\u003C\/code\u003E\n\u003Cbr\u003E\n\u003Cbr\u003E\nAn error response has the following properties:\n\n| name      | value |\n|---        |---    |\n| status    | HTTP status code    |\n| error_code | Unique code for this type of error|\n| title     | Short, human readable description of the error|\n| type      | URL where more information about the error can be found |\n| details   | (Optional) List of issues providing  details why the request failed |\n\u003Cbr\u003E\nBelow is an example of how an error response might look. \u003Cbr\u003E\n\u003Cpre\u003E\n\u003Ccode class=\u0022language-json\u0022\u003E{\n    \u0022status\u0022: 401,\n    \u0022error_code\u0022: 18,\n    \u0022title\u0022: \u0022The credentials you provided are not valid\u0022,\n    \u0022type\u0022: \u0022https:\/\/developer.mopinion.com\/api\/error-codes#invalid-credentials\u0022\n}\u003C\/code\u003E\n\u003C\/pre\u003E\n\nWe \u003Cstrong\u003Estrongly advise\u003C\/strong\u003E you to use either the \u003Ccode\u003Eerror_code\u003C\/code\u003E or \u003Ccode\u003Etype\u003C\/code\u003E properties, rather than the \u003Ccode\u003Estatus\u003C\/code\u003E for any error handling in your application, since the latter may occur for multiple types of errors.\n\n","termsOfService":"http:\/\/mopinion.com\/terms\/","version":"2.5.5","x-logo":{"url":"https:\/\/s3.amazonaws.com\/groovehq\/uploaded\/NrnpDR-zHL3yZckABssB?1473252083"}},"host":"api.mopinion.com","basePath":"\/","schemes":["https"],"consumes":["application\/json"],"produces":["application\/json"],"paths":{"\/account":{"get":{"tags":["account"],"summary":"Get account data","parameters":[{"$ref":"#\/parameters\/versionParam"}],"responses":{"200":{"description":"Returns information about the user\u0027s account. Also the reports and their ID\u0027s.","schema":{"$ref":"#\/definitions\/account"}},"401":{"description":"Unauthorized"},"404":{"description":"Account not found"}}}},"\/token":{"get":{"tags":["general"],"summary":"Get a signature token","parameters":[{"$ref":"#\/parameters\/versionParam"},{"$ref":"#\/parameters\/basicAuthParam"}],"responses":{"200":{"description":"Returns the token to be used for generating a HMAC signature.","schema":{"properties":{"token":{"type":"string","example":"$1gn47ur3T0k3n"}},"type":"object"}},"401":{"description":"Unauthorized"},"404":{"description":"Account not found"}}}},"\/datasets\/{dataset-id}":{"get":{"tags":["datasets"],"summary":"Get some basic info on a dataset","parameters":[{"$ref":"#\/parameters\/versionParam"},{"$ref":"#\/parameters\/datasetIdParam"}],"responses":{"200":{"description":"Dataset object","schema":{"$ref":"#\/definitions\/datasetResponse"}},"400":{"description":"Dataset id not set"},"401":{"description":"Unauthorized"},"404":{"description":"Dataset not found"}}}},"\/datasets\/{dataset-id}\/fields":{"get":{"tags":["datasets","fields"],"summary":"Get fields for a dataset","parameters":[{"$ref":"#\/parameters\/versionParam"},{"$ref":"#\/parameters\/datasetIdParam"}],"responses":{"200":{"description":"Get fields for the given dataset","schema":{"$ref":"#\/definitions\/fieldSet"}},"400":{"description":"Dataset id not set"},"401":{"description":"Unauthorized"},"404":{"description":"Dataset not found"}}}},"\/datasets\/{dataset-id}\/feedback[\/{feedback-id}]":{"get":{"tags":["feedback"],"summary":"Get feedback from a dataset","parameters":[{"$ref":"#\/parameters\/versionParam"},{"$ref":"#\/parameters\/limitParam"},{"$ref":"#\/parameters\/pageParam"},{"$ref":"#\/parameters\/datasetIdParam"},{"$ref":"#\/parameters\/feedbackIdParam"},{"$ref":"#\/parameters\/filterParam"}],"responses":{"200":{"description":"Retrieve feedback items for the given dataset","schema":{"$ref":"#\/definitions\/feedbackSet"}},"400":{"description":"Dataset id not set"},"401":{"description":"Unauthorized"},"404":{"description":"Dataset not found"}}}},"\/deployments":{"get":{"tags":["deployments"],"summary":"Get form deployment data","parameters":[{"$ref":"#\/parameters\/versionParam"}],"responses":{"200":{"description":"Returns information about the user\u0027s deployments.","schema":{"$ref":"#\/definitions\/deploymentResponse"}},"401":{"description":"Unauthorized"},"404":{"description":"No deployments found"}}}},"\/deployments\/{deployment-id}":{"get":{"tags":["deployments"],"summary":"Get details for a deployment","parameters":[{"$ref":"#\/parameters\/deploymentIdParam"}],"responses":{"200":{"description":"OK","schema":{"properties":{"code":{"description":"Return code","type":"integer","example":200},"response":{"description":"","type":"boolean","example":true},"global":{"description":"Global data","type":"array","items":{"properties":{"service":{"description":"","type":"string","example":"mopinion"},"version":{"description":"","type":"string","example":"2.0"},"stats":{"description":"","type":"bolean","example":true}},"type":"object"}},"deployment":{"description":"Deployment data","type":"array","items":{"properties":{"domain":{"description":"Domain","type":"string","example":"demo.mopinion.com"},"id":{"description":"Deployment id","type":"string","example":"dw3eotyrfymt2we5ny5x8t3f8lhdd39j2ru"},"org_id":{"description":"Organisation id","type":"integer","example":124},"version":{"description":"API version","type":"string","example":"2.2"},"type":{"description":"Deployment type","type":"string","example":"sdk"},"name":{"description":"Deployment name","type":"string","example":"App"},"published":{"description":"Published","type":"boolean","example":true},"rules":{"description":"Rules","type":"array","items":{"properties":{"then":{"description":"Then condition","type":"array","items":{"properties":{"webview":{"description":"Webview","type":"boolean","example":true},"args":{"description":"","type":"array","example":["0cdbb7a5b69b5c84f5701a2b50e8a86840f1a44e","demo.mopinion.com","surveyContent"]},"service":{"description":"","type":"string","example":"mopinion"}},"type":"object"}},"id":{"description":"","type":"string","example":"nnyzjboc0kieq6plm41tfoer78sx1hzp"},"if":{"description":"If condition","type":"array","items":{"properties":{"session":{"description":"","type":"integer","example":30},"clock":{"description":"","type":"array","items":{"properties":{"operator":{"description":"","type":"string","example":"between"},"time2":{"description":"","type":"string","example":"23:00"},"time":{"description":"","type":"string","example":"12:00"}},"type":"object"}},"mobile":{"description":"","type":"array","items":{"properties":{"events":{"description":"","type":"array","example":["_button, _link"]},"target":{"description":"","type":"array","items":{"properties":{"version":{"description":"Version","type":"array","example":["14"]},"os":{"description":"OS","type":"string","example":"ios"}},"type":"object"}}},"type":"object"}},"trigger":{"description":"","type":"string","example":"passive"},"time":{"description":"","type":"integer","example":0},"date":{"description":"","type":"array","items":{"properties":{"operator":{"description":"","type":"array","example":"between"},"date":{"description":"","type":"string","example":"15\/10\/2020"},"date2":{"description":"","type":"string","example":"16\/10\/2020"}},"type":"object"}},"percentage":{"description":"","type":"integer","example":95}},"type":"object"}}},"type":"object"}}},"type":"object"}}},"type":"object"}},"401":{"description":"Unauthorized"}}}},"\/reports\/{report-id}":{"get":{"tags":["reports"],"summary":"Get some basic info on a report","parameters":[{"$ref":"#\/parameters\/versionParam"},{"$ref":"#\/parameters\/reportIdParam"}],"responses":{"200":{"description":"Report object including its datasets","schema":{"$ref":"#\/definitions\/reportResponse"}},"400":{"description":"Report id not set"},"401":{"description":"Unauthorized"},"404":{"description":"Report not found"}}}},"\/reports\/{report-id}\/fields":{"get":{"tags":["fields"],"summary":"Get fields for a report","parameters":[{"$ref":"#\/parameters\/versionParam"},{"$ref":"#\/parameters\/reportIdParam"}],"responses":{"200":{"description":"Retrieve feedback fields for the given report","schema":{"$ref":"#\/definitions\/fieldSet"}},"400":{"description":"Report id not set"},"401":{"description":"Unauthorized"},"404":{"description":"Report not found"}}}},"\/reports\/{report-id}\/feedback[\/{feedback-id}]":{"get":{"tags":["feedback"],"summary":"Get feedback for a report","parameters":[{"$ref":"#\/parameters\/versionParam"},{"$ref":"#\/parameters\/limitParam"},{"$ref":"#\/parameters\/pageParam"},{"$ref":"#\/parameters\/reportIdParam"},{"$ref":"#\/parameters\/feedbackIdParam"},{"$ref":"#\/parameters\/filterParam"}],"responses":{"200":{"description":"Retrieve feedback items for the given report","schema":{"$ref":"#\/definitions\/feedbackSet"}},"400":{"description":"Report id not set"},"401":{"description":"Unauthorized"},"404":{"description":"Report not found"}}}},"\/ping":{"get":{"tags":["general"],"summary":"Test the API\u0027s availability","responses":{"200":{"description":"OK","schema":{"properties":{"code":{"type":"integer","example":200},"response":{"type":"string","example":"pong"},"version":{"type":"string","example":"2.5.5"}},"type":"object"}},"500":{"description":"Unknown error"},"502":{"description":"API not available"}}}}},"definitions":{"deleteResponse":{"type":"object","allOf":[{"properties":{"executed":{"description":"Whether or not the request was executed","type":"boolean","example":false},"resources_affected":{"description":"Listing of the (potentially) affected resources","type":"object"}}}]},"Problem":{"properties":{"status":{"description":"HTTP status code","type":"integer","example":"401"},"error_code":{"description":"Unique error code","type":"integer","example":"6"},"title":{"description":"Short description of the problem","type":"string","example":"Route does not exist"},"type":{"description":"URI for problem documentation","type":"string","example":"https:\/\/developer.mopinion.com\/api\/error-codes#route-not-found"}},"type":"object"},"account":{"properties":{"name":{"description":"Organisation name","type":"string","example":"E-Corp."},"package":{"description":"License package type","type":"string","example":"Growth Package"},"enddate":{"description":"Date license ends","type":"string","example":"2018-12-31 23:59:00"},"number_users":{"description":"Maximum number of users","type":"integer","example":5},"number_charts":{"description":"Maximum number of charts","type":"integer","example":12},"number_forms":{"description":"Maximum number of forms","type":"integer","example":20},"number_reports":{"description":"Maximum number of reports","type":"integer","example":3},"reports":{"type":"array","items":{"$ref":"#\/definitions\/reportResponse"}}},"type":"object"},"dataset":{"properties":{"name":{"description":"Dataset name","type":"string","example":"Web care performance"},"report_id":{"description":"Identifier for the report this dataset belongs to","type":"integer","example":"854"},"description":{"description":"Description of the dataset","type":"string","example":"Historic data import"}},"type":"object"},"datasetResponse":{"type":"object","allOf":[{"properties":{"id":{"description":"Identifier for the report this dataset belongs to","type":"integer","example":123}}},{"$ref":"#\/definitions\/dataset"},{"properties":{"data_source":{"description":"Source providing data for this dataset","type":"string","example":"import"}}}]},"datasetPutBody":{"type":"object","allOf":[{"properties":{"name":{"description":"Dataset name","type":"string","example":"Web care performance"},"description":{"description":"Description of the dataset","type":"string","example":"Historic data import"}}}]},"datasetPostBody":{"required":["name","report_id"],"type":"object","allOf":[{"$ref":"#\/definitions\/dataset"}]},"deployment":{"properties":{"key":{"description":"Deployment identifier","type":"string","example":"76pg3seur7occo1hogv88eltdtmxoxxl81vj"},"name":{"description":"Deployment name","type":"string","example":"Default implementation"}},"type":"object"},"deploymentResponse":{"type":"array","items":{"$ref":"#\/definitions\/deployment"}},"deploymentPostBody":{"required":["name"],"type":"object","allOf":[{"$ref":"#\/definitions\/deployment"}]},"feedbackSet":{"type":"array","items":{"$ref":"#\/definitions\/feedback"}},"feedback":{"properties":{"id":{"description":"Feedback item identifier","type":"string","example":"218463"},"created":{"description":"Feedback item creation date","type":"string","example":"2017-01-15"},"report_id":{"description":"Report identifier","type":"integer","example":"987"},"dataset_id":{"description":"Dataset identifier","type":"integer","example":"123"},"fields":{"type":"array","items":{"$ref":"#\/definitions\/feedbackValue"}},"tags":{"description":"An array of tags applied to the feedback item","type":"array","example":["callback","UX"]}},"type":"object"},"feedbackValue":{"properties":{"key":{"description":"Item identifier","type":"string","example":"ratio"},"label":{"description":"Full field label","type":"string","example":"How would you rate your overall experience?"},"value":{"description":"Feedback value","type":"string","example":"7"}},"type":"object"},"fieldSet":{"type":"array","items":{"$ref":"#\/definitions\/field"}},"field":{"properties":{"report_id":{"description":"Report identifier","type":"integer","example":438},"dataset_id":{"description":"Dataset identifier","type":"integer","example":560},"label":{"description":"Full field label","type":"string","example":"How would you rate your overall experience?"},"short_label":{"description":"Short version of the field label","type":"string","example":"Overall experience"},"key":{"description":"Field identifier","type":"string","example":"3.Rating.f3d142f4"},"type":{"description":"Field variable type","type":"string","example":"ratio"},"group_key":{"description":"Name of the question group the field belongs to","type":"string","example":"12.CHECKBOX.GROUP.456"},"answer_options":{"description":"(optional) additional properties","type":"object"}},"type":"object"},"report":{"properties":{"name":{"description":"Report name","type":"string","example":"Customer Support"},"description":{"description":"Report description","type":"string","example":"Everything customer support related"},"language":{"description":"Report language","type":"string","example":"en_US"}},"type":"object"},"reportResponse":{"type":"object","allOf":[{"properties":{"id":{"description":"Identifier for the report this report belongs to","type":"integer","example":"987"}}},{"$ref":"#\/definitions\/report"},{"properties":{"created":{"description":"Report creation date","type":"string","example":"2017-09-29"},"dataSets":{"type":"array","items":{"$ref":"#\/definitions\/datasetResponse"}}}}]},"reportPostResponse":{"type":"object","allOf":[{"$ref":"#\/definitions\/reportResponse"},{"properties":{"dataSets":{"type":"array"}}}]},"reportPostBody":{"required":["name"],"type":"object","allOf":[{"$ref":"#\/definitions\/report"}]}},"parameters":{"basicAuthParam":{"name":"authorization","in":"header","description":"Basic authorization header","required":true,"type":"string"},"datasetIdParam":{"name":"dataset-id","in":"path","description":"The id for the dataset","required":true,"type":"integer"},"datasetPostBodyParam":{"name":"body","in":"body","description":"A JSON formatted string (see example)","schema":{"properties":{"executed":{"description":"Whether or not the request was executed","type":"boolean","example":false},"resources_affected":{"description":"Listing of the (potentially) affected resources","type":"object"}},"$ref":"#\/definitions\/datasetPostBody"}},"datasetPutBodyParam":{"name":"body","in":"body","description":"A JSON formatted string (see example)","schema":{"properties":{"executed":{"description":"Whether or not the request was executed","type":"boolean","example":false},"resources_affected":{"description":"Listing of the (potentially) affected resources","type":"object"}},"$ref":"#\/definitions\/datasetPutBody"}},"deploymentIdParam":{"name":"deployment_id","in":"path","description":"The id for the deployment","required":true,"type":"string"},"deploymentBodyParam":{"name":"body","in":"body","description":"A JSON formatted string (see example)","required":true,"schema":{"properties":{"executed":{"description":"Whether or not the request was executed","type":"boolean","example":false},"resources_affected":{"description":"Listing of the (potentially) affected resources","type":"object"}},"$ref":"#\/definitions\/deploymentPostBody"},"type":"string"},"reportIdParam":{"name":"report-id","in":"path","description":"The id for the report","required":true,"type":"integer"},"reportPostBodyParam":{"name":"body","in":"body","description":"A JSON formatted string (see example)","schema":{"properties":{"executed":{"description":"Whether or not the request was executed","type":"boolean","example":false},"resources_affected":{"description":"Listing of the (potentially) affected resources","type":"object"}},"$ref":"#\/definitions\/reportPostBody"}},"reportPutBodyParam":{"name":"body","in":"body","description":"A JSON formatted string (see example)","schema":{"properties":{"executed":{"description":"Whether or not the request was executed","type":"boolean","example":false},"resources_affected":{"description":"Listing of the (potentially) affected resources","type":"object"}},"$ref":"#\/definitions\/report"}},"domainParam":{"name":"domain","in":"header","description":"The full domain you use to access the mopinion suite","type":"string","default":"demo.mopinion.com"},"versionParam":{"name":"version","in":"header","description":"The API version to use","type":"string","default":"2.5.5"},"feedbackIdParam":{"name":"feedback-id","in":"path","description":"A feedback id or a comma seperated list of feedback id\u0027s","type":"string"},"dryRunParam":{"name":"dry-run","in":"query","description":"To simulate the request, add a query parameter `dry-run=true` to the request URL. (Accepted values are `1`,`true`,`True` and `TRUE`). The response will return the resources that would be affected by the request. \u003Cbr\u003E\u003Cstrong\u003ENOTE\u003C\/strong\u003E: Do not use quotes around the value (ie `dry-run=\u0027true\u0027`) as this will be evaluated to `false`, resulting in  the actual removal of the data.","type":"integer","default":false},"filterParam":{"name":"filter","in":"query","description":"Filter feedback results.\u003Ca href=\u0022#section\/Requests-and-Responses\/Filters\u0022\u003ERead more about using filters\u003C\/a\u003E","type":"string"},"dateFromParam":{"name":"date_from","in":"query","description":"Start value for date time filter range, defaults to False","type":"integer"},"dateToParam":{"name":"date_to","in":"query","description":"End value for date time filter range, defaults to today","type":"integer"},"searchToParam":{"name":"search","in":"query","description":"Search","type":"integer"},"TagParam":{"name":"tag","in":"query","description":"Tag","type":"string"},"limitParam":{"name":"limit","in":"query","description":"Maximum number of results in response","type":"integer","default":10,"maximum":1000},"pageParam":{"name":"page","in":"query","description":"Return result page","type":"integer"},"sortParam":{"name":"sort","in":"query","description":"Property to use for sorting the results","type":"integer"},"orderParam":{"name":"order","in":"query","description":"Sorting direction (asc, desc)","type":"string"}},"x-tagGroups":[{"name":"General","tags":["general"]},{"name":"Resources","tags":["account","deployments","datasets","fields","feedback","reports"]}],"x-ignoredHeaderParameters":["version"]}