Is there a way for me to check (through PHP code) the status of a SurveyGizmo link?
For example, if the link is “sgizmo.com/i21412/523-0” – if I grab the HTML results of that page, is there a unique identifier in there that will tell me that this link is either
“Complete” / “Disqualified”?
Hello Shopper Army!
While it may be possible to manually fetch the HTML contents of the page that a specific unique survey link generates, and parse/munge that HTML markup to try and determine the status of that response, you will be far better off accessing this information via SurveyGizmo’s REST API.
The unique link you’ve used as an example looks very much like the unique links that our Email Campaign feature generates, so I’ll use that as an example. Part of the unique link will be a contact ID (this will be appended as the “sguid” variable). You may use this contact ID in a filter string to fetch that specific survey response, when calling the “GET LIST” method of the SurveyResponse object:
An example URI for requesting a specific contact ID’s response could be like so:
I recommend using a library to make the API request from PHP, such as Ryan McCue’s aptly-named “Requests for PHP” library.
Once you have received the response, you can access the “status” property of the first item in the “data” section, to see the status of that response. Use var_dump if you’re unsure what I mean by that, or if you seem to be getting an invalid response.
I hope this helps!