-
Notifications
You must be signed in to change notification settings - Fork 0
mails
The mails endpoind is used to list and create emails. It's also used to send/resend verification emails.
🚨FOR ALL MAIL ENDPOINTS (Except the verify endpoint) A ROCKSTARS AUTHENTICATION SCOPE IS REQUIRED🚨
- Create a get method, so the mails can be shown.
- Create a create method, so new mails can be created.
- Create an update method, so mails can be changed.
- Create a remove method, so mails can be removed.
- Create a
mails/verifyendpoint so a verification email can be (re)send. - Create a
mails/eventendpoint for sending new event emails.
The get endpoints do not use any body text.
-
/api/mailsreturns all emails. -
/api/mails/[id]returns email with specificid.
-
[]- There are no emails to show -
404- The specific email you're looking for doesn't exist.
200 OK - returns a JSON object with all/specific email(s).
The post endpoints require all body data as described.
-
/api/mailsreturns the data added to the DB.-
title(required, string, max:191, unique) - The title. -
language(required, string, max:191) - The language the email is written in. -
subject(required, string, max:191) - The subject of the email. -
body(required, string, max:16.500.00) - The body of the email (This is probably HTML).
-
- Error is only trown when body data is incorrect. Errors are in english like the example below.
{
"message": "The given data was invalid.",
"errors": {
"title": [
"The title has already been taken."
]
}
}
201 Created - returns a JSON object with the created email data.
The put endpoints do not require anything in the body. Only add the fields you want to change to the body.
-
/api/mails/[id]returns the entire (edited) email.-
title(string, max:191, unique) - The title. -
language(string, max:191) - The language the email is written in. -
subject(string, max:191) - The subject of the email. -
body(string, max:16.500.00) - The body of the email (This is probably HTML).
-
- Errors are equal to the
create endpoint - No error will be trown when the body is empty
200 OK - returns a JSON object with the updated email data.
The delete endpoint does not require anything in the body.
-
/api/mails/[id]removes the event and returns it.
404 Not found - The requested email does not exist
200 OK - returns a JSON object with the removed email.
THIS ENDPOINT WILL BE AUTOMATICALLY CALLED WHEN A NEW USER IS CREATED, ONLY USE THIS IF YOU NEED TO RESEND THE EMAIL
The post endpoints require all body data as described.
-
/api/mails/verifyreturns the data added to the DB.-
email(required, email, max:191) - The email of the recipient.
-
- Error is only trown when body data is incorrect. Errors are in english like the example below.
{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email must be a valid email address."
]
}
}
201 Created - does not return a JSON object.