Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Writing a REST Service with Cloud Pages - PUT Method
If @action=="put" and not empty (@entrycode) and not empty(@Email) and not empty(@Lname) and not empty (@Name) and not empty (@phone) then
Set @rowsAffected = UPSERTDATA("Register",1,"EmailAddress", @Email,"EntryCode",@entrycode,"FirstName",@Name,"LastName",@Lname,"PhoneNumber",@phone)
If (@rowsAffected >0) then
set @Json= '{"status": "ok","message": "Your information was saved correctly"}'
output(v(@Json))
Endif
if(@rowsAffected ==0)then
set @Json= '{"status": "Error","message": "Invalid EntryCode"}'
output(v(@Json))
endif
endif
Endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment