Rest Request Parameters

Shane Cao asked on September 12, 2018 18:09

I setup user registration on my kentico site. One of the fields I have the user input is an AccessCode field which is a 4 digit number. I want to take that code and pass it to an api Endpoint and get back a JSON Object to build my page.

My question is that I am not quite sure how to get the user access code to pass to the url.

What's the best way of going about this.

Also I believe when I get the databack I can build the page using transformations correct?

Recent Answers

David te Kloese answered on September 13, 2018 11:55

So does the access code get validated before you can register?

Or is it just used on the confirmation page after you've registered?

1 votesVote for this answer Mark as a Correct answer

Shane Cao answered on September 13, 2018 15:55 (last edited on September 13, 2018 16:08)

Thanks for the response and recommendation!

No the access code does not, it's just an identifier for myself and the 3rd party api I am trying to use. This access code needs to be passed to the custom api endpoint. Which I was trying to just do in a javascript webpart, but I'm not sure how I can get the current logged in users account data in kentico to pass to the endpoint.

I actually like what you recommended more and will probably go that route, but my question would still be how can I access the AccessCode field to send to the api on page load?

Edit: actually since its a custom webpart, can't I just handle getting the users data in the backend code?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.