MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Base URL

http://merk.loc

Authenticating requests

This API is not authenticated.

Contact

Contact Us Send Form

Example request:
const url = new URL(
    "http://merk.loc/api/contacts"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "efrain53@example.org",
    "name": "dolor",
    "phone": "quaerat",
    "subject": "sunt",
    "message": "voluptate",
    "is_subscription": "1"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Successfully sent"
}
 

Example response (422):


{
    "errors": {
        "email": [
            "The Email Address field is required."
        ],
        "name": [
            "The Your Name field is required."
        ],
        "subject": [
            "The Subject field is required."
        ],
        "message": [
            "The Message field is required."
        ],
        "is_subscription": [
            "The Subscribe me field is required."
        ]
    }
}
 

Request      

POST api/contacts

Body Parameters

email  string  

Must be a valid email address.

name  string  

phone  string optional  

subject  string  

message  string  

is_subscription  integer  

Must be one of 0 or 1.

Subscription

Example request:
const url = new URL(
    "http://merk.loc/api/contacts/subscription"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "bwiza@example.net",
    "name": "modi"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "You successfully subscribed"
}
 

Example response (422):


{
    "errors": {
        "email": [
            "The Email Address field is required."
        ],
        "name": [
            "The Your Name field is required."
        ]
    }
}
 

Request      

POST api/contacts/subscription

Body Parameters

email  string  

Must be a valid email address.

name  string