Rest API Documentation for Survey module
EP : Extended Permissions
+ : Consider the permission with + and all permissions above it.
Permission hierarchy : Account Admin > Project Manager > Project Member > Contact
Following are object types where survey is supported,
Project = 3
Following is the list of output columns for Survey Response list call,
responseDate
recipientUserEmail
emailMessage
firstName
lastName
comment
rating
lastSentOn
urlExpiryTime
lastSentBy
files
Following is the list of output columns map for Survey Response,
[
{"name": "recipientUserEmail", "value": "RECIPIENT EMAIL" },
{"name": "lastSentBy", "value": "LAST SENT BY" },
{"name": "emailMessage", "value": "EMAIL MESSAGE" },
{"name": "responseDate","value": "RESPONSE DATE"},
{"name": "rating","value": "RATING"},
{"name": "lastSentOn", "value": "LAST SENT"},
{"name": "urlExpiryTime","value": "EXPIRATION DATE"},
{"name": "files", "value": "FILES ATTACHED"}
]
Following is the json format for File Copy parameter on send and update Survey with an example.
{
"fileCopyItems": [
{
"fileId": File id from project or library which has to copy to current survey,
"title": new file name, if needed otherwise empty ("").
},
{
"fileId": 11407752,
"title": "updated.pdf"
}
]
}
Paths List all operations
/survey.do?cmd=SendSurvey
- GET /survey.do?cmd=SendSurvey
Summary
Send survey to users.
Description
Send survey in email to internal and external users.
Access
- User with Manage permission to project
Parameters
Name Located in Description Required Schema projectId query Provide project Id
Yes integerrecipientUserIds query Provide comma separated user Ids to which send survey.
No stringrecipientEmailIds query Provide comma separated user external user emails to which send survey.
No stringcomment query Provide comment for survey, comment will be sent in email to Recipients.
No stringurlExpiryTime query Provide expiry date for survey. after expiry date survey responses are not accepeted.
No string (Date)fileIds query Provide comma separated file ids to attach with survey.
No stringfileCopyJson query Provide the files want to copy from Project & Library to this survey in JSON format. Refer this.
No stringResponses
/survey.do?cmd=UpdateSurvey
- GET /survey.do?cmd=UpdateSurvey
Summary
Update survey.
Description
Update the existing survey for sent survey
Access
- User with Manage permission to project
Parameters
Name Located in Description Required Schema id query Provide existing survey id which have to update.
Yes integerrecipientUserIds query Provide comma separated user Ids to which send survey.
No stringrecipientEmailIds query Provide comma separated user external user emails to which send survey.
No stringdeletedRecipientIds query Provide comma separated user Ids to which want to remove from survey.
No stringcomment query Provide comment for survey, comment will be sent in email to Recipients.
No stringurlExpiryTime query Provide expiry date for survey. after expiry date survey responses are not accepeted.
No string (Date)fileIds query Provide comma separated file ids to attach with survey.
No stringoldfileIds query Provide comma separated file ids which are previously attach with survey.
No stringfileCopyJson query Provide the files want to copy from Project & Library to this survey in JSON format. Refer this.
No stringnotifyUsers query Provide option 1 or 2. 1 To send notification to all users. 2 To send notification for newly added users.
No integerResponses
/survey.do?cmd=SurveyAvailableUserList
- GET /survey.do?cmd=SurveyAvailableUserList
Summary
List the internal users to send as recipient Ids for creating survey.
Description
List the users which are available for the survey as recipient for given project Id.
Access
- User with Manage permission to project
Parameters
Name Located in Description Required Schema projectId query Provide project Id
Yes integerResponses
Response Type Description Success List of available users.
Schema
: UserResponse Sample : [ { "id": 9999, "createdBy": 10000, "createdOn": "10/20/2018 01:12 PM US/Eastern", "state": 0, "firstName": "Anonymous", "lastName": "User", "emailAddress": "testUser2@robohead.net", "userDisplayName": "Anonymous User", "userTypeAheadDisplayName": null, "isTimeslipExist": false, "leaf": true, "teamMember": true, "parentObjectCreator": false }, { "id": 10000, "createdBy": 10000, "createdOn": "01/15/2014 02:54 PM US/Eastern", "state": 0, "firstName": "Application", "lastName": "Admin", "emailAddress": "testuser@robohead.net", "userDisplayName": "Application Admin", "userTypeAheadDisplayName": null, "isTimeslipExist": false, "leaf": true, "teamMember": false, "parentObjectCreator": false }]
Failure Unexpected error
Schema
: Result
/survey.do?cmd=GetSurveyResponseList
- GET /survey.do?cmd=GetSurveyResponseList
Summary
List survey responses.
Description
List the survey Responses.
Access
- User with minimum view permission to project
Parameters
Name Located in Description Required Schema projectId query Provide project Id whose survey responses want to list
Yes integeroutputColumns query Provide comma separated List of output columns to list.
Refer to List of output columns at the top.
No stringResponses
Response Type Description Success List of available users.
Schema
: SurveyResponseResponse Sample : { "returnCode": 0, "messageKey": null, "detailedMessage": null, "exception": null, "browser": null, "sessionId": null, "customParams": { "surveyResponseList": [ { "id": 1687, "surveyRecipient": { "id": 195, "userByUserId": null, "account": null, "survey": null, "userByLastSentBy": { "firstName": "veranika", "lastName": "tower", "emailAddress": "adminUser@robohead.net", "userDisplayName": "Application Admin", }, "recipientEmail": null, "surveyUrl": null, "sentStatus": 0, "lastSentOn": "11/05/2020 12:52 PM US/Eastern", "recipientUserEmail": "jholloway@VeronikaAquent.com" }, "survey": { "id": 136, "account": null, "createdBy": 0, "createdOn": null, "modifiedBy": 0, "modifiedOn": null, "projectId": 0, "comment": null, "urlExpiryTime": null, "surveyFiles": [ { "id": null, "account": null, "createdBy": 0, "createdOn": null, "modifiedBy": null, "modifiedOn": null, "state": 0, "objectId": null, "objectType": 0, "fileName": "Screen Shot 2020-10-22 at 7.37.43 AM.png", "title": null, "mimeType": null, "size": 0, "numPages": 0, "height": null, "width": null, "rhS3Path": null, "fileProcessStatus": null, "displayOnFilesTab": null, "templateId": null, "fileVersionById": null, "createdByUserName": null, "originalFileUrl": null, "thumbnailUrl": null, "previewImageUrl": null, "fileSecurity": 0, "objectName": null, "rhcInfo": null, "modifiedByUser": null, "parentFileId": 0, "versionDescription": null, "fileVersion": 0, "tags": null, "fileId": 0, "object": null } ] }, "createdOn": "10/30/2020 11:35 AM US/Eastern", "modifiedOn": null, "rating": 2, "firstName": "Joan", "lastName": "tower", "comment": "Nice work" } ], "averageSurveyScore": 1.666700000 }, "errorMessages": null, "success": true }
Failure Unexpected error
Schema
: Result
/survey.do?cmd=ExportSurveyResponseList
- GET /survey.do?cmd=ExportSurveyResponseList
Summary
Export survey responses.
Description
Export survey Responses.
Access
- User with minimum view permission to project
Parameters
Name Located in Description Required Schema projectId query Provide project Id whose survey responses want to export
Yes integerobjectType query Provide object type (Survey only supports object type project) Object Types at the top.
Yes integeroutputColumns query Provide comma separated List of output columns to list.
Refer to List of output columns at the top.
No stringoutputColumnMap query Provide the Json of Mapping of output columns to Xlsx sheet column names.
Refer to Output columns Map at the top.
No stringsortColumn query Provide column name from outputColumns to sort on
Yes stringsortDirection query Provide direction to sort the sortColumn Direction may be "DESC" or "ASC"
Yes stringResponses
Response Type Description Success Downloads SurveyResults.xlsx
Failure Unexpected error
Schema
: Result
/survey.do?cmd=SendSurveyReminder
- GET /survey.do?cmd=SendSurveyReminder
Summary
Send survey reminder.
Description
Sends reminder to selected survey recipients.
Access
- User with minimum view permission to project
Parameters
Name Located in Description Required Schema projectId query Provide project Id.
Yes integerrecipientIds query Provide comma separated List survey recipients Id's.
No stringResponses
/survey.do?cmd=GetLastSurvey
- GET /survey.do?cmd=GetLastSurvey
Summary
Get last survey.
Description
Gets last survey created for given object Id.
Access
- User with Manage permission to project
Parameters
Name Located in Description Required Schema projectId query Provide project Id
Yes integerResponses
Response Type Description Success Last survey retrived successfully.
Schema
: SurveyResponse Sample : { "id": 176, "account": { }, "createdBy": 10007, "createdOn": "11/18/2020 09:38 AM US/Eastern", "modifiedBy": 10007, "modifiedOn": "11/18/2020 09:38 AM US/Eastern", "projectId": 2355997, "comment": "test", "urlExpiryTime": "11/30/2020 12:00 AM US/Eastern", "surveyFiles": [ { "id": 1144414883, "account": null, "createdBy": 1004407, "createdOn": "11/18/2020 09:38 AM US/Eastern", "modifiedBy": null, "modifiedOn": null, "state": 0, "objectId": null, "objectType": 70, "fileName": "Penguins.jpg", "title": null, "mimeType": "image/jpeg", "size": 777835, "numPages": 0, "height": null, "width": null, "rhS3Path": null, "fileProcessStatus": null, "displayOnFilesTab": null, "templateId": null, "fileVersionById": null, "createdByUserName": null, "originalFileUrl": null, "thumbnailUrl": "/file.do?cmd\u003dDownloadFile\u0026accountId\u003d10000\u0026documentType\u003d22\u0026fileId\u003d11414883\u0026_dc\u003d16057918h36717", "previewImageUrl": "/file.do?cmd\u003dDownloadFile\u0026accountId\u003d10000\u0026documentType\u003d70\u0026fileId\u003d11414883\u0026_dc\u003d160h5791836717", "fileSecurity": 0, "objectName": null, "rhcInfo": null, "modifiedByUser": null, "parentFileId": 0, "versionDescription": null, "fileVersion": 0, "tags": null, "fileId": 0, "object": null } ] }
Failure Unexpected error
Schema
: Result