A client can call the following REST api URI to allow an unauthenticated user to send an enquiry to a business
POST /v1/public/{business_name}/enquiries
An authenticated user of the system can then view the enquiry through the following call:
GET /v1/businesses/{business_name}/enquiries/{enquiry_id}
When a new enquiry is posted, the business is informed via email. The email includes a link to the enquiry. The issue I have is that the API will add the following link to email:
http://ift.tt/1yZHx4m}
When a user clicks the link in the email, they will be incorrectly taken to the API resource instead of the client page. So I need the email to contain the following link:
http://ift.tt/1z1IyO2}
Noted: Above client URL is an example. Clients can implement their own routing however they want, a single page client app URL could also be used. The point is, the client URL must be exposed in the email, not the API URL.
Im not quite sure how to get client URLs into the email.
One option would be to provide a client URL in the original POST request. Problem with this is that the client won't know the URL to use until after the POST, at which point the email has already been added to the queue.
Another option is to pull out the queueing of emails from the API and make the clients responsible for it. I don't really like this idea as client implementers will not be too happy that they purchased the API, only to then find out they then have to decide when to queue emails.
Aucun commentaire:
Enregistrer un commentaire