Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Zendesk and Corona
Started by agramonte May 31 2018 06:16 AM

No replies to this topic
zendesk api
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 757 posts
  • Corona SDK

I use Zendesk for customer feedback. I have the cheapest plan $5.00 a month. Just sharing my implementation in case anybody wants to use it:

local json = require "json";
local requestBody = {}
	requestBody.request = {}
	requestBody.request.requester = {}
	requestBody.request.subject = "feedback" -- My form doesn't have a subject line. I default to this.
	requestBody.request.comment = {}
        requestBody.request.comment.body = message -- String of the message.
	
if not (email:match("^[%w.]+@%w+%.%w+$")) then -- Didn't provide an e-mail. So send anon feedback.
	requestBody.request.requester.name = "Anonymous customer"
else -- Email provided.
	requestBody.request.requester.name = email -- My form does not have a name line. I use the e-mail again.
	requestBody.request.requester.email = email	
end

local url = "https://<youraccount>.zendesk.com/api/v2/requests.json" -- Use your zendesk url.

local headers = {}
headers["Content-Type"] = "application/json"

local params = {}
params.body = json.encode (requestBody)
params.headers = headers
	
network.request( url, "POST", networkListener, params ) -- networklistener replies back the response.

  • roaminggamer and sporkfin like this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: zendesk, api