Download the PHP package mrdth/decipher-api without Composer
On this page you can find all versions of the php package mrdth/decipher-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mrdth/decipher-api
More information about mrdth/decipher-api
Files in mrdth/decipher-api
Package decipher-api
Short Description PHP Wrapper for the FocusVision Decipher REST Api
License MIT
Informations about the package decipher-api
Decipher API
This package provides a PHP wrapper for the FocusVision Decipher API, along with binding for using it in Laravel applications.
Installation
Install with composer:
Usage In Laravel
Add two new env vars:
- DECIPHER_API_URI_BASE - base URI for the decipher api (E.g. https://v2.decipherinc.com/api/v1/)
- DECIPHER_API_KEY - API key for the application
The package will be auto-registered, and can be accessed via it's facade.
All calls to the API via the wrapper should be carried out inside a try - catch block; The wrapper does not deal with any Exceptions thrown by the underlying Guzzle client.
#
Usage as a standalone PHP Package
All calls to the API via the wrapper should be carried out inside a try - catch block; The wrapper does not deal with any Exceptions thrown by the underlying Guzzle client.
Methods exposed via the wrapper
- getSurveyList() - Get a list of all surveys available with the current API key.
- setServerDirectory(string $directory) - Directory where your projects are stored on the decipher server
- setSurveyId(int $id) - Set the ID of the current survey to work with.
- setCondition(string $condition) - Condition required to retrieve the participant. This is a Python condition as if you would enter in survey logic or crosstabs. For example, “qualified and q3.r2” retrieves only participants that were qualified and answered q3 as r2.
- getSurveyStructure(string $format) - Retrieve the structure of available questions for a survey, returning htem in the specified format. Valid formats are: html, json, text, tab
- getSurveyData(array $fields = ['all'], string $format = 'json') - Retrieve the responses to the question IDs passed in $fields from Decipher. Note: uuid & status fields will always be returned. Any condition set using ::setCondition() will be applied
- getSurveyFile(string $filename) - Retrieve the survey file called $filename as a string.