{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/survey/:id/answer/sms/invite","auth":"required","examples":{"codes":[]},"settings":"","results":{"codes":[{"name":"","status":200,"language":"json","code":"{\n    \"answerId\": 669335967,\n    \"phoneNumber\": \"+358 50 4131354\",\n    \"hash\": \"hDINchm2qxmFmIMQqeTZASMN9jaJRcLhcEI_asI6l07RwtdJy4PniJ-k3KNWRhak\",\n    \"url\": \"https://my.surveypal.com/app/inv3?recipient=-669335967-hDINchm2qxmFmIMQqeTZASMN9jaJRcLhcEI_asI6l07RwtdJy4PniJ-k3KNWRhak-PrivateLinkDoNotShare\",\n    \"emailTaskId\": 669323422\n}"},{"status":201,"language":"json","code":"{\n    \"answerId\": 669335967,\n    \"phoneNumber\": \"+358 50 4131354\",\n    \"hash\": \"hDINchm2qxmFmIMQqeTZASMN9jaJRcLhcEI_asI6l07RwtdJy4PniJ-k3KNWRhak\",\n    \"url\": \"https://my.surveypal.com/app/inv3?recipient=-669335967-hDINchm2qxmFmIMQqeTZASMN9jaJRcLhcEI_asI6l07RwtdJy4PniJ-k3KNWRhak-PrivateLinkDoNotShare\",\n    \"emailTaskId\": 669323422\n}","name":""},{"status":300,"language":"text","code":"This is an error status. Existing email address found."}]},"method":"put","params":[{"name":"id","type":"int","default":"","desc":"Target survey id","required":true,"in":"path","ref":"","_id":"54a0f26858c49f0b00140cbf"},{"name":"phoneNumber","type":"string","default":"","desc":"The answer phone number. Use country prefix \"00\" instead of \"+\", for example 00358401234567.","required":true,"in":"query","ref":"","_id":"54a0e7cd58c49f0b00140c9a"},{"name":"unique","type":"boolean","default":"true","desc":"The answer phone number is required to be unique among the survey.","required":false,"in":"query","ref":"","_id":"54a0f31658c49f0b00140cc3"},{"name":"anonymous","type":"boolean","default":"false","desc":"The answer phone number is shown anonymously in the results.","required":false,"in":"query","ref":"","_id":"54a0f22058c49f0b00140cbb"},{"name":"localeId","type":"string","default":"null","desc":"The answer language identifier. If survey doesn't contain specified language then first language will be selected. http://developer.surveypal.com/v1.0/docs/locale-id-parameter","required":false,"in":"query","ref":"","_id":"54a0f22058c49f0b00140cba"},{"name":"meta","type":"string","default":"","desc":"A JSON array of meta information for the answer. http://developer.surveypal.com/v1.0/docs/meta-parameter","required":false,"in":"query","ref":"","_id":"54a0ec11b9c6160b00b93de2"},{"name":"subject","type":"string","default":"","desc":"The invitation subject. Not in use with SMS so just add some content like \"test\".","required":true,"in":"query","ref":"","_id":"54a0f35b58c49f0b00140cc7"},{"name":"message","type":"string","default":"","desc":"The invitation message. You can add line break with %0a","required":true,"in":"query","ref":"","_id":"54a0f35b58c49f0b00140cc6"},{"name":"sendAt","type":"string","default":"now","desc":"The date and time when to send the invitation. http://developer.surveypal.com/v1.0/docs/timestamp-parameter","required":false,"in":"query","ref":"","_id":"54a0f35b58c49f0b00140cc5"}]},"next":{"description":"","pages":[]},"title":"/survey/{id}/answer/sms/invite","type":"endpoint","slug":"surveyidanswersmsinvite","excerpt":"Send an SMS invitation to the survey.","body":"Will send an SMS invitation to the survey.\n\nSubject and message are mandatory fields only when you send request first time. After this you don't need to send these because these are saved to the survey. If subject and message are saved to survey before you send first request then you don't need to send these at all.\n\nMessage can be 138 characters long. We will add short 22 characters invitation link after the message.\n\nBefore you can send invitations:\n- SMS channel must be activated by Surveypal\n- Survey must be launched (Build > Launch)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.ajax({\\n  method: \\\"PUT\\\",\\n  url: 'https://my.surveypal.com/api/rest/survey/:id/answer/sms/invite?phoneNumber=:phoneNumber&unique=:unique&anonymous=:anonymous&meta=:meta&localeId=:localeId&subject=:subject&message=:message&sendAt=:sendAt',\\n  headers: {\\n    \\\"X-Auth-Token\\\": \\\"YOUR-TOKEN\\\",\\n    \\\"Accept\\\": \\\"application/json\\\"\\n  }\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"jQuery\"\n    },\n    {\n      \"code\": \"curl -i -X PUT \\\\\\n   -H \\\"X-Auth-Token:YOUR-TOKEN\\\" \\\\\\n   -H \\\"Accept:application/json\\\" \\\\\\n 'https://my.surveypal.com/api/rest/survey/:id/answer/sms/invite?phoneNumber=:phoneNumber&unique=:unique&anonymous=:anonymous&meta=:meta&localeId=:localeId&subject=:subject&message=:message&sendAt=:sendAt'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","updates":[],"order":15,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5a6835010aee650012fd2c5e","project":"5474381b59fade080004c920","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5474381b59fade080004c924","5474387f59fade080004c927","547d639078fd57080023cb81","549eb883b67f031400a5dc0e","54c87c8bab03760d00c8e4ec","54ca1480eb42170d0045d3c6","54ca1539dd5cf30d00c35135","560e634e59cb8d0d0015cce1","560e7bfc59cb8d0d0015ccfb","562531976ff1010d009b16f0","57c0378264ebf60e006886d9","57c037912588020e004b5c8e"],"_id":"5474381b59fade080004c923","createdAt":"2014-11-25T08:04:43.418Z","releaseDate":"2014-11-25T08:04:43.418Z","project":"5474381b59fade080004c920","__v":12},"category":{"sync":{"isSync":false,"url":""},"pages":["547d6ab078fd57080023cb9c","547d6ad678fd57080023cba0","547d6cf12eaee50800ed11c5","547d70b678fd57080023cbaa","547d70e878fd57080023cbac","549eb4c87483040b001e9f79","549eb781b67f031400a5dc09","54a0e7cd58c49f0b00140c99","54a0e80b58c49f0b00140c9c","54a0e88cb9c6160b00b93dce","54a0e8ffb9c6160b00b93dd7","54a0ebd2b9c6160b00b93ddf","54a0ec11b9c6160b00b93de0","54a0ec62b9c6160b00b93de3","54a0ec8d58c49f0b00140c9f","54a0ecad58c49f0b00140ca1","54a0ecd958c49f0b00140ca2","54a0ed2cb9c6160b00b93de4","54a0ed5f58c49f0b00140ca3","54a0ed90b9c6160b00b93de7","54a0edc658c49f0b00140ca5","54a0eded58c49f0b00140ca8","54a0ee1b58c49f0b00140ca9","54a0ee8858c49f0b00140caa","54a0eed758c49f0b00140cb1","54a0f22058c49f0b00140cb9","54a0f25a58c49f0b00140cbd","54a0f2a858c49f0b00140cc0","54a0f2c458c49f0b00140cc1","54a0f31658c49f0b00140cc2","54a0f35b58c49f0b00140cc4","54a0f38558c49f0b00140cca","54a0f3b058c49f0b00140ccc","54a0f407b9c6160b00b93de9","54c63654f52b710d00d643d6","54c636cdf0320f0d00ac9b4e","54c636ef355b790d003c1223","54c63704f52b710d00d643d9","54c63726f52b710d00d643da","54c884cde317000d007c2841","54c88669ab03760d00c8e4ee","54c88704e317000d007c2844","54c89b40353f830d00678dc6","54c89bc119d1910d004feb3d","54c8b7b54574700d00f015ee","54c8bac50174630d00efa81a","54c8bd4e0174630d00efa81f","54cb3ffd61698d0d00baf765","5608ca086d8c440d000c79d1","5609326031beb60d001b65b0","560a273587b71d0d000d3a40","560a2d17ee8a910d0072f75d","56125a9a0157131900b45858","56125bf5ad4dab0d0064d288","56125f152afc821700a5b1f9","561b92d5868acd0d0043ad8a"],"title":"Endpoints","slug":"endpoints","order":1,"from_sync":false,"reference":false,"_id":"547d639078fd57080023cb81","__v":56,"createdAt":"2014-12-02T07:00:32.464Z","project":"5474381b59fade080004c920","version":"5474381b59fade080004c923"},"user":"5474380459fade080004c91d","createdAt":"2018-01-24T07:25:53.301Z","githubsync":"","__v":10,"parentDoc":null}

put/survey/{id}/answer/sms/invite

Send an SMS invitation to the survey.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
integer
Target survey id

Query Params

phoneNumber:
required
string
The answer phone number. Use country prefix "00" instead of "+", for example 00358401234567.
unique:
booleantrue
The answer phone number is required to be unique among the survey.
anonymous:
booleanfalse
The answer phone number is shown anonymously in the results.
localeId:
stringnull
The answer language identifier. If survey doesn't contain specified language then first language will be selected. http://developer.surveypal.com/v1.0/docs/locale-id-parameter
meta:
string
A JSON array of meta information for the answer. http://developer.surveypal.com/v1.0/docs/meta-parameter
subject:
required
string
The invitation subject. Not in use with SMS so just add some content like "test".
message:
required
string
The invitation message. You can add line break with %0a
sendAt:
stringnow
The date and time when to send the invitation. http://developer.surveypal.com/v1.0/docs/timestamp-parameter

Result Format


Documentation

Will send an SMS invitation to the survey. Subject and message are mandatory fields only when you send request first time. After this you don't need to send these because these are saved to the survey. If subject and message are saved to survey before you send first request then you don't need to send these at all. Message can be 138 characters long. We will add short 22 characters invitation link after the message. Before you can send invitations: - SMS channel must be activated by Surveypal - Survey must be launched (Build > Launch) [block:code] { "codes": [ { "code": "$.ajax({\n method: \"PUT\",\n url: 'https://my.surveypal.com/api/rest/survey/:id/answer/sms/invite?phoneNumber=:phoneNumber&unique=:unique&anonymous=:anonymous&meta=:meta&localeId=:localeId&subject=:subject&message=:message&sendAt=:sendAt',\n headers: {\n \"X-Auth-Token\": \"YOUR-TOKEN\",\n \"Accept\": \"application/json\"\n }\n});", "language": "javascript", "name": "jQuery" }, { "code": "curl -i -X PUT \\\n -H \"X-Auth-Token:YOUR-TOKEN\" \\\n -H \"Accept:application/json\" \\\n 'https://my.surveypal.com/api/rest/survey/:id/answer/sms/invite?phoneNumber=:phoneNumber&unique=:unique&anonymous=:anonymous&meta=:meta&localeId=:localeId&subject=:subject&message=:message&sendAt=:sendAt'", "language": "curl" } ] } [/block]

User Information

Try It Out

put
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}