Authentication

Authentication digunakan sebagai otentikasi akun agar user dapat menggunakan OpenAPI dengan Method POST,PUT, DELETE dan method action lainnya selain GET. Untuk membatasi adanya pengiriman data massal.

Authentication User

Login User

POST https://openapi.omdo.site/api/login

Multipart/form-data

Request Body

Name
Type
Description

email*

string

The email account user

password*

string

The password of account user

{
  "success": true,
  "message": "Login Successful",
  "data": {
    "id": 2,
    "name": "rizkan",
    "email": "[email protected]",
    "email_verified_at": "2023-08-30T16:51:54.548Z",
    "created_at": "2023-07-04T05:09:19.000000Z",
    "updated_at": "2023-07-04T05:09:19.000000Z",
    "token": "4|iiKlCYbsKJWp1m7m6o5NqQOuGUdUk3u3PMtEKTI1"
  },
  "token": "JWT Token"
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://openapi.omdo.site/api/login',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('email' => '[email protected]','password' => 'password123'),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Good to know: Token digunakan untuk melakukan POST, PUT, DELETE, PATCH method pada beberapa endpoint untuk tetap menjaga ada nya tindakan masal pada beberapa endpoint.

Register User

POST https://openapi.omdo.site/api/register

Multipart/form-data

Request Body

Name
Type
Description

email*

string

The email new account user

password*

string

The password of new account user

confirm_password*

String

The password confirmation of account user registered

name*

String

The nameof new account user

{
  "success": true,
  "message": "Register Successful",
  "data": {
    "id": 2,
    "name": "rizkan",
    "email": "[email protected]",
    "email_verified_at": "2023-08-30T16:58:37.110Z",
    "created_at": "2023-07-04T05:09:19.000000Z",
    "updated_at": "2023-07-04T05:09:19.000000Z",
    "token": "4|iiKlCYbsKJWp1m7m6o5NqQOuGUdUk3u3PMtEKTI1"
  }
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://openapi.omdo.site/api/register',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('email' => '[email protected]','password' => 'password123','name' => 'User Test','confirm_password' => 'password123'),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Good to know: Untuk beberapa alasan, sistem logout masih dalam tahap development. Mohon untuk menunggu sistem update berikutnya, oke 👍.

Last updated