Displayr API Reference

/API/Upload

Uploads a file to temporary storage for use in a later command.

Try me
Verb:POST
Request body:A normal (multipart) HTTP file upload, as per RFC 1867.
Returns:Empty body. The "UploadID" response header contains the ID to be used in subsequent calls to the API.
Example URI:https://app.displayr.com/API/Upload
Using curl: curl --dump-header upload.headers --form "file=@blah.sav" https://app.displayr.com/API/Upload
Afterwards the upload ID will be contained in upload.headers, after "UploadID: "

/API/NewProjectFromScript

Creates a new document by running the script POSTed with this request.

Try me
Verb:POST (Parameters (in bold below) should be placed in the URI like a GET querystring, not in multipart/form-data in the request body.)
companyA secret code unique to your company. Contact support to obtain this.
nameName for the new document.
contact A person's contact name to enter for the new document, so users can see who is responsible for this document. Corresponds to the Contact field in Document Settings.
notes Optional. Any notes to attach to this document. Corresponds to the Notes field in Document Settings.
public_url Whether the public URL should be available. Corresponds to the same setting in Document Settings.  (Deprecated; use view_mode_access instead)
is_free Optional; false by default. Whether the document should start in free mode or not. If you have purchased a licence, and are creating a document that needs to use professional features (e.g. higher data limits), this should be false. If you have not purchased a licence, this should be true.
view_mode_access Optional; N by default. Whether the document is exported or not and how it should be exported. Possible values are: N (None), P (Public), V (Private), or L (Link).
view Names of groups of users that can read from this document. If the groups named do not exist then they will be silently ignored.
edit Names of groups of users that can write to this document. If the groups named do not exist then they will be silently ignored.
Request body: The script, in UTF8. The only supported language is QScript.
Returns: The body of the response describes any error (errors will also have 4xx or 5xx status codes) and includes the output log from the script. A ProjectSecret response header will contain the unique identifier for the new document.
Example URI:https://app.displayr.com/API/NewProjectFromScript?company=2101F346-3ACB-4234-8321-CA12EFD1CF71&name=Banana+Survey&contact=Joe+Blogs&view_mode_access=P&view=View+Projects&view=Banana+Growers&edit=Edit+Projects

/API/NewProjectFromQPack

Creates a new Displayr document using an Archive Pack (of a previously created document) which has been uploaded via /API/Upload.

Try me
Verb:POST (Parameters (in bold below) should be placed in the URI like a GET querystring, not in multipart/form-data in the request body.)
file_name The file name of the Archive Pack (without any path information). Only displayed to users.
upload_idThe ID returned by API/Upload.
companyA secret code unique to your company. Contact support to obtain this.
nameName for the new document.
contact A person's contact name to enter for the new document, so users can see who is responsible for this document. Corresponds to the Contact field in Document Settings.
notes Optional. Any notes to attach to this document. Corresponds to the Notes field in Document Settings.
public_url Whether the public URL should be available. Corresponds to the same setting in Document Settings.  (Deprecated; use view_mode_access instead)
is_free Optional; false by default. Whether the document should start in free mode or not. If you have purchased a licence, and are creating a document that needs to use professional features (e.g. higher data limits), this should be false. If you have not purchased a licence, this should be true.
view_mode_access Optional; N by default. Whether the document is exported or not and how it should be exported. Possible values are: N (None), P (Public), V (Private), or L (Link).
view Names of groups of users that can read from this document. If the groups named do not exist then they will be silently ignored.
edit Names of groups of users that can write to this document. If the groups named do not exist then they will be silently ignored.
Request body:Empty.
Returns: The body of the response describes any error (errors will also have 4xx or 5xx status codes) and includes the output log from the script. A ProjectSecret response header will contain the unique identifier for the new document.
Example URI:https://app.displayr.com/API/NewProjectFromQPack?file_name=Document.QPack&upload_id=C4251794-AD2E-4657-9A0C-4AC0C68C4FCA&company=2101F346-3ACB-4234-8321-CA12EFD1CF71&name=Banana+Survey&contact=Joe+Blogs&view_mode_access=P&view=View+Projects&view=Banana+Growers&edit=Edit+Projects

/API/ImportUpdatedData

Updates a raw data file in an existing document. Before calling this you must upload the new file using API/Upload. If uploading partial data (only new cases) then you must specify both old_serial and new_serial.

Try me
Verb:POST (Parameters (in bold below) should be placed in the URI like a GET querystring, not in multipart/form-data in the request body.)
project A secret code unique to the document. If you created the document using the API then this is returned in the ProjectSecret response header. Check the Document Settings page for manually-uploaded documents.
data_name The name of the data file to be replaced. Normally this is the data file's name (including extension, but not including a directory), although a user can customise the name used to refer to a data file.
new_data_file_name Optional. The file name that should be used for the data file when you download the updated Archive Pack. This will not affect its Data File Name if that has been changed using Displayr.
upload_id The ID returned by API/Upload. The new file must have the same file type (e.g. SPSS .sav) as the old one.
new_serial Your serial number for the data file, which indicates the newness of the included data. This can be any string up to 255 unicode characters in length. For example, it might be the last date/time stamp in the file, or the last case number. Include this with partial data, and if subsequent uploads may be partial, otherwise omit it.
old_serial Supplying this parameter indicates that your new data file is partial (only contains new cases). It must match the new_serial supplied with the previous use of this method. If it does not match, or the previous upload was not performed using the API, then status code 412 (Precondition Failed) will be returned. In this case you should retry the operation, but provide the complete data file (and new_serial, but not old_serial). Partial data only works with SPSS data files. Network failures are inevitable so your system must be able to receive a failure status code and then retry the upload later, rather than losing the new cases.
abort When to abort the update if problems are encountered. Aborted updates will automatically roll back the document to its previous data.
NeverAny problems that can be ignored will be ignored.
OnError Serious problems will abort the update (e.g. missing variables or missing categories that cause constructed variables such as filters to become invalid).
OnWarning Warnings will abort the update (e.g. new categories, new variables).
publish false to prevent the dashboard being published (default is true).
Request body:Empty.
Returns: An HTML fragment containing information about data differences or merge problems that were detected. Empty if no differences encountered. Note that something appearing here may not mean the update failed, so check for error status codes.
Example URI:https://app.displayr.com/API/ImportUpdatedData?project=61780ED5-E97F-4F11-9BD1-59079CD8FB91&data_name=Phone.sav&upload_id=C4251794-AD2E-4657-9A0C-4AC0C68C4FCA&new_serial=822&abort=OnError

/API/RunScript

Runs the script POSTed with this request in an existing document.

Try me
Verb:POST (Parameters (in bold below) should be placed in the URI like a GET querystring, not in multipart/form-data in the request body.)
project A secret code unique to the document. If you created the document using the API then this is returned in the ProjectSecret response header. Check the Document Settings page for manually-uploaded documents.
Request body: The script, in UTF8. The only supported language is QScript.
Returns: The body of the response describes any error (errors will also have 4xx or 5xx status codes) and includes the output log from the script.
Example URI:https://app.displayr.com/API/RunScript?project=61780ED5-E97F-4F11-9BD1-59079CD8FB91

/API/PublishProject

Publishes (or republishes) a project to the web.

Try me
Verb:POST
project A secret code unique to the document. If you created the document using the API then this is returned in the ProjectSecret response header. Check the Document Settings page for manually-uploaded documents.
view_mode_access Set the permissions for the specified project. A value of N unpublishes a previously published project Possible values are: N (None), P (Public), V (Private), or L (Link).
public_can_explore Only applicable to Link('L') exports - Viewers can explore without a password. Defaults to false.
public_can_search Only applicable to Link('L') exports - Searchable from other company documents that can be viewed without a password. Defaults to false.
views_enabled Viewers can add, change, delete, and apply views. Defaults to false.
Returns: The body of the response describes any error (errors will also have 4xx or 5xx status codes). If the document does not exist then this is not considered an error. A ProjectUrl response header which will contain the url of the exported project
Example URI:https://app.displayr.com/API/PublishProject?project=5501F346-3ACB-4234-8321-CA12EFD1C888&view_mode_access=L&pubic_can_search=true&views_enabled=true

/API/DeleteProject

Deletes a document previously created by the API.

Try me
Verb:DELETE
project A secret code unique to the document. If you created the document using the API then this is returned in the ProjectSecret response header. Check the Document Settings page for manually-uploaded documents.
Returns: The body of the response describes any error (errors will also have 4xx or 5xx status codes). If the document does not exist then this is not considered an error.
Example URI:https://app.displayr.com/API/DeleteProject?project=5501F346-3ACB-4234-8321-CA12EFD1C888