Skip to main content

API For Testing

Download Postman Collection

 

Base URL

https://fdlux-template.globeapp.dev/api

 

Authentication

Register

  • Method: POST

  • Endpoint: baseURL/register

  • Request

    https://fdlux-template.globeapp.dev/api/register

    headers
    {
    "Content-Type": "application/json"
    }
    body
    {
    "name": "fdlux",
    "email": "fdlux@email.com",
    "password": "password"
    }
  • Response

    201
    {
    "id": 1,
    "name": "fdlux",
    "email": "fdlux@email.com"
    }

Login

  • Method: POST

  • Endpoint: baseURL/login

  • Request

    https://fdlux-template.globeapp.dev/api/login

    headers
    {
    "Content-Type": "application/json"
    }
    body
    {
    "email": "fdlux@email.com",
    "password": "password"
    }
  • Response

    200
    {
    "token": {
    "text": "qwertyuiop",
    "type": "Bearer",
    "expire_at": "2024-12-17T00:02:38.816371"
    },
    "user": {
    "id": 1,
    "name": "Name",
    "email": "fdlux@email.com"
    }
    }

 

Main

Fetch Analytic

  • Method: GET

  • Endpoint: baseURL/analytic

  • Request

    https://fdlux-template.globeapp.dev/api/analytic

    headers
    {
    "Content-Type": "application/json",
    "Authorization": "Bearer $textToken",
    }
  • Response:

    200
    {
    "income": {
    "last_week": [
    {
    "date": "2024-12-16",
    "income": 12000
    },
    ...
    ]
    }
    }

Search

  • Method: GET

  • Endpoint: baseURL/query

  • Params:

    • query: as query search
  • Request

    https://fdlux-template.globeapp.dev/api/search?query=core

    headers
    {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer $textToken',
    }
  • Response:

    200
    {
    "result": [
    {
    "title": "Core",
    "description": "Built-in types, collections, and other core functionality for every Dart program."
    },
    {
    "title": "Collection",
    "description": "Classes and utilities that supplement the collection support in dart:core."
    }
    ]
    }

 

Note

Fetch Notes + pagination / infinite scroll

  • Method: GET

  • Endpoint: baseURL/notes

  • Params:

    • lastId: as offset (page)
    • limit: as item count per page
  • Request

    https://fdlux-template.globeapp.dev/api/notes?lastId=10&limit=10

    headers
    {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer $textToken',
    }
  • Response:

    200
    {
    "notes": [
    {
    "id": 11,
    "title": "Note 11",
    "description": "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type\n"
    },
    ...
    {
    "id": 20,
    "title": "Note 20",
    "description": "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type\n"
    }
    ]
    }

Fetch Note by ID

  • Method: GET

  • Endpoint: baseURL/notes/[id]

  • Request

    https://fdlux-template.globeapp.dev/api/notes/1

    headers
    {
    "Content-Type": "application/json",
    "Authorization": "Bearer $textToken",
    }
  • Response:

    200
    {
    "note": {
    "id": 1,
    "title": "Note 1",
    "description": "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type\n"
    }
    }

Create Note

  • Method: POST

  • Endpoint: baseURL/notes

  • Request

    https://fdlux-template.globeapp.dev/api/notes

    headers
    {
    "Content-Type": "application/json",
    "Authorization": "Bearer $textToken"
    }
    body
    {
    "title": "title 1",
    "description": "description 1"
    }
  • Response

    201
    {
    "note": {
    "id": 0,
    "title": "title 1",
    "description": "description 1"
    }
    }

Update Note

  • Method: PUT

  • Endpoint: baseURL/notes/[id]

  • Request

    https://fdlux-template.globeapp.dev/api/notes/1

    headers
    {
    "Content-Type": "application/json",
    "Authorization": "Bearer $textToken"
    }
    body
    {
    "title": "title 10",
    "description": "description 10"
    }
  • Response

    200
    {
    "note": {
    "id": 0,
    "title": "title 10",
    "description": "description 10"
    }
    }

Delete Note

  • Method: DELETE

  • Endpoint: baseURL/notes/[id]

  • Request

    https://fdlux-template.globeapp.dev/api/notes/1

    headers
    {
    "Content-Type": "application/json",
    "Authorization": "Bearer $textToken"
    }
  • Response

    204
    // No Content

 

Destination

Fetch Destination by ID

  • Method: GET

  • Endpoint: baseURL/destinations/[id]

  • Request

    https://fdlux-template.globeapp.dev/api/destinations/1

    headers
    {
    "Content-Type": "application/json",
    "Authorization": "Bearer $textToken",
    }
  • Response:

    200
    {
    "destination": {
    "id": 1,
    "name": "Kamojang Ecopark",
    "image": "https://drive.usercontent.google.com/download?id=13bdnvQHgo1kwY01qoFoQEjedjYb7gwTR",
    "address": "Jl. Samarang Garut, Cisarua, Kec. Samarang, Kabupaten Garut, Jawa Barat 44161",
    "description": "Tourist attraction with a forest background. There are many recreation spots, resting places, camping, and selfies.",
    "rating": 4.7
    }
    }

Fetch Popular Destination

  • Method: GET

  • Endpoint: baseURL/destinations/popular

  • Request

    https://fdlux-template.globeapp.dev/api/destinations/popular

    headers
    {
    "Content-Type": "application/json",
    "Authorization": "Bearer $textToken",
    }
  • Response:

    200
    {
    "destinations": [
    {
    "id": 1,
    "name": "Kamojang Ecopark",
    "image": "https://drive.usercontent.google.com/download?id=13bdnvQHgo1kwY01qoFoQEjedjYb7gwTR",
    "address": "Jl. Samarang Garut, Cisarua, Kec. Samarang, Kabupaten Garut, Jawa Barat 44161",
    "description": "Tourist attraction with a forest background. There are many recreation spots, resting places, camping, and selfies.",
    "rating": 4.7
    },
    ...
    ]
    }

Fetch Nearby Destination

  • Method: GET

  • Endpoint: baseURL/destinations/nearby

  • Request

    https://fdlux-template.globeapp.dev/api/destinations/nearby

    headers
    {
    "Content-Type": "application/json",
    "Authorization": "Bearer $textToken",
    }
  • Response:

    200
    {
    "destinations": [
    {
    "id": 1,
    "name": "Kamojang Ecopark",
    "image": "https://drive.usercontent.google.com/download?id=13bdnvQHgo1kwY01qoFoQEjedjYb7gwTR",
    "address": "Jl. Samarang Garut, Cisarua, Kec. Samarang, Kabupaten Garut, Jawa Barat 44161",
    "description": "Tourist attraction with a forest background. There are many recreation spots, resting places, camping, and selfies.",
    "rating": 4.7
    },
    ...
    ]
    }