Introduction
Welcome to CodeBakery Digital Agency developer API documentation.
ReCaptcha
We use Google ReCaptcha v3 to make sure the API request is by a person using the website. Every POST request must include the headers with recaptcha-token-v3. Google ReCaptcha v3 Documentation.
| Parameter | Value | CORS |
|---|---|---|
| siteKey | 6Lcg570gAAAAAIyyWJN-9rC19GE5k0T3iyBhsklf |
https://codebakery.ca |
Public Endpoint
POST Contact Message
This endpoint allows website users to submit contact messages to CodeBakery Digital Agency Team. The backend server will send a summary message to the email provided.
Response example (200)
{
"id": "147b57f5-9362-4099-9cd3-7c918a5ebc75",
"createdAt": "2022-08-02T00:54:59.588Z"
}
Response example (422)
{
"errors": [
{
"msg": "must be alphabetic",
"param": "firstName",
"location": "body"
},
{
"msg": "must be valid email address",
"param": "email",
"location": "body"
},
{
"msg": "must be a string",
"param": "message",
"location": "body"
}
]
}
HTTP Request
POST https://api.codebakery.ca/v1/pub/contact/message
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| recaptcha-token-v3 | String | Yes | ReCaptcha response generated by siteKey. |
Request Body
Content-Type
application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| firstName | String | Yes | Contact person's first name. eg. John |
| lastName | String | Yes | Contact person's last name. eg. Doe |
| String | Yes | Email address. eg. johndoe@gmail.com |
|
| phone | String | No | Phone number. eg. 1-647-123-4567 |
| message | String | Yes | Contact message. |
HTTP Response
Content-Type
application/json
| Parameter | Type | Description |
|---|---|---|
| id | String | Contact message ID. |
| createdAt | String | Contact message created at. |
POST Emailer
This endpoint temporarily allows sending an email with codebakery domain name.
Response example (200)
{
"status": "success",
"data": {}
}
Response example (422)
{
"errors": [
{
"value": "john@example.com",
"msg": "must be domain codebakery.ca",
"param": "from",
"location": "body"
},
{
"msg": "must be valid email address",
"param": "to",
"location": "body"
},
{
"msg": "must be a string",
"param": "subject",
"location": "body"
},
{
"msg": "must be a string",
"param": "message",
"location": "body"
}
]
}
HTTP Request
POST https://api.codebakery.ca/v1/pub/emailer/send
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| x-password | String | Yes | Password protected. |
Request Body
Content-Type
application/json
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| name | String | CodeBakery Support |
No | Name of the from email address. eg. John Doe |
| from | String | support@codebakery.ca |
No | From email address. It must be codebakery.ca domain. |
| to | String | - | Yes | Send email to address. eg. client@gmail.com |
| subject | String | - | Yes | Email subject. eg. Re: webstie development question |
| message | String | - | Yes | Email message. eg. Response and copy-paste received message. |
| type | String | text/plain |
No | Email message type. [text/plain, 'text/html'] |
Errors
The codebakery API uses the following error codes:
| Error Code | Meaning |
|---|---|
| 400 | Bad Request -- Your request is invalid. |
| 401 | Unauthorized -- Your JWT is invalid or expired. |
| 403 | Forbidden -- Your request is unauthorized. |
| 404 | Not Found -- Your request route could not be found. |
| 422 | Unprocessable -- Your request is valid, but it could not process the contained instructions. |
| 429 | Too Many Requests -- Too many request. |
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |