MENU navbar-image

Introduction


Dokumentasi lengkap API Smart - Solusi API untuk aplikasi Sales dan Smart

Pastikan saat melakukan request menambahkan bearer token di header and, token di dapatkan dari return api login "api_token"

Authenticating requests

This API is not authenticated.

Auth

Login

Example request:
curl --request POST \
    "http://api.pmpsmart.com/api/v1/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"email@pmpsmart.com\",
    \"password\": \"*****\"
}"
const url = new URL(
    "http://api.pmpsmart.com/api/v1/auth/login"
);

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

let body = {
    "email": "email@pmpsmart.com",
    "password": "*****"
};

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

Example response (200):


{
"status": success,
"message": "Submit Login berhasil",
"data": [data]
}
 

Request      

POST api/v1/auth/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   email   

email pengguna. Example: email@pmpsmart.com

password   string   

Password pengguna. Example: *****

Logout

Example request:
curl --request POST \
    "http://api.pmpsmart.com/api/v1/auth/logout" \
    --header "Authorization: Bearer {token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api.pmpsmart.com/api/v1/auth/logout"
);

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

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

Example response (200):


{
"status": success,
"message": "Logout berhasil",
"data": [data]
}
 

Request      

POST api/v1/auth/logout

Headers

Authorization      

Example: Bearer {token}

Content-Type      

Example: application/json

Accept      

Example: application/json