M
M
Michaebuff2021-01-07 13:40:13
API
Michaebuff, 2021-01-07 13:40:13

Returning a result in a user friendly form?

My API needs to send emails containing unique links.

There was a problem with which address to generate a link to. Let's say, if a user enters his mail in the form of an iOS client, then it will be sent to the server, validation will be performed, a check for the presence of a user with such an address, etc., and then, if everything is successful, the client will be redirected to a notification page indicating that that he is about to receive a message with instructions in the mail and he must respond to it.

So, at the moment when the server fixes that it is possible to send a message, you need to generate an address that checks the incoming uidb and token, and if you generate a link for the address inside the DRF project, the user, by clicking on it, will see the result in REST format.

I settled on the conclusion that it is best to direct the user to a web client that accesses this API and there already transfer data back to the API. But after my question regarding where you can bind this address with the frontend, I was told that it was impossible to know for sure and it would be wrong. But how do you do it all then?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2021-01-07
@AstraVlad

Understood nothing. If a unique link is generated, then the user should see something on this link, at least "Goodbye and thanks for the fish." So we add something like "/for emails" to the path, in a regular view (not @api_view) we get the parameters from the request, process them (for example, write to the database "email confirmed") and show the stub page. What is the problem?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question