Delcom Open API Logo

Delcom

Link Trees

Dokumentasi API

Link Trees

Link Trees Endpoint

info: Mengolah data link tree.


Base URL

https://open-api.delcom.org/api/v1

Add New Link Tree

Membuat halaman kumpulan tautan (link tree) baru.

  • URL
    • /link-trees
  • Method
    • POST
  • Headers
    • Content-Type: application/json
    • Authorization: Bearer <token>
  • Request Body
    • title as string
    • type as string only public, unlisted, private
    • description as string
  • Contoh Request
    POST {{BaseURL}}/link-trees
    Accept: application/json
    Authorization: Bearer <token>
    Content-Type: application/json
    
    {
        "title": "Contoh Judul",
        "type": "public",
        "description": "Contoh deskripsi"
    }
    
  • Response Berhasil
    {
        "status": "success",
        "message": "Berhasil menambahkan data",
        "data": {
            "link_tree_id": 1
        }
    }
    
  • Response Gagal
    {
        "status": "fail",
        "message": "Data tidak valid",
        "data": {
            "field": [
                "Pesan validasi"
            ]
        }
    }
    

Change Cover Link Tree

Mengunggah atau memperbarui gambar sampul (cover) halaman link tree.

  • URL
    • /link-trees/:id/cover
  • Method
    • POST
  • Headers
    • Content-Type: multipart/form-data
    • Authorization: Bearer <token>
  • Request Body
    • cover as file
  • Contoh Request
    POST {{BaseURL}}/link-trees/1/cover
    Accept: application/json
    Authorization: Bearer <token>
    Content-Type: multipart/form-data; boundary=----DelcomFormBoundary
    
    ------DelcomFormBoundary
    Content-Disposition: form-data; name="cover"; filename="cover.jpg"
    Content-Type: image/jpeg
    
    < ./cover.jpg
    ------DelcomFormBoundary--
    
  • Response Berhasil
    {
        "status": "success",
        "message": "Berhasil mengubah cover"
    }
    
  • Response Gagal
    {
        "status": "fail",
        "message": "Data tidak valid",
        "data": {
            "field": [
                "Pesan validasi"
            ]
        }
    }
    

Update Link Tree

Memperbarui judul, tipe, atau deskripsi halaman link tree.

  • URL
    • /link-trees/:id
  • Method
    • PUT
  • Headers
    • Content-Type: application/json
    • Authorization: Bearer <token>
  • Request Body
    • title as string
    • type as string only public, unlisted, private
    • description as string
  • Contoh Request
    PUT {{BaseURL}}/link-trees/1
    Accept: application/json
    Authorization: Bearer <token>
    Content-Type: application/json
    
    {
        "title": "Contoh Judul",
        "type": "public",
        "description": "Contoh deskripsi"
    }
    
  • Response Berhasil
    {
        "status": "success",
        "message": "Berhasil mengubah data"
    }
    
  • Response Gagal
    {
        "status": "fail",
        "message": "Data tidak valid",
        "data": {
            "field": [
                "Pesan validasi"
            ]
        }
    }
    

Get All Link Trees

Mengambil seluruh daftar halaman link tree yang dimiliki atau publik.

  • URL
    • /link-trees
  • Parameters
    • is_me as 1
      • Notes:
        • 1 as retrieve all data own
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Contoh Request
    GET {{BaseURL}}/link-trees
    Accept: application/json
    Authorization: Bearer <token>
    
  • Response Berhasil
    {
        "status": "success",
        "message": "Berhasil mengambil data",
        "data": {
            "link_trees": [
                {
                    "id": 2,
                    "user_id": 1,
                    "title": "Kursus Ku",
                    "type": "public",
                    "description": "Ini merupakan kumpulan kursus ku",
                    "cover": "http://localhost:8000/",
                    "created_at": "2025-03-09T01:32:33.000000Z",
                    "updated_at": "2025-03-09T01:32:33.000000Z",
                    "author": {
                        "name": "Abdullah Ubaid",
                        "photo": "http://localhost:8000/default/img/user.png"
                    },
                    "total_links": 0
                }
            ]
        }
    }
    
  • Response Gagal
    {
        "status": "fail",
        "message": "Data tidak valid",
        "data": {
            "field": [
                "Pesan validasi"
            ]
        }
    }
    

Detail Link Tree

Mendapatkan detail halaman link tree beserta seluruh daftar tautan di dalamnya.

  • URL
    • /link-trees/:id
  • Method
    • GET
  • Headers
    • Authorization: Bearer <token>
  • Contoh Request
    GET {{BaseURL}}/link-trees/1
    Accept: application/json
    Authorization: Bearer <token>
    
  • Response Berhasil
    {
        "status": "success",
        "message": "Berhasil mengambil data",
        "data": {
            "link_tree": {
                "id": 2,
                "user_id": 1,
                "title": "Kursus Ku",
                "type": "public",
                "description": "Ini merupakan kumpulan kursus ku",
                "cover": "http://localhost:8000/",
                "created_at": "2025-03-09T01:32:33.000000Z",
                "updated_at": "2025-03-09T01:32:33.000000Z",
                "author": {
                    "name": "Abdullah Ubaid",
                    "photo": "http://localhost:8000/default/img/user.png"
                },
                "items": [
                    {
                        "id": 2,
                        "link_tree_id": 2,
                        "title": "Dasar Java",
                        "url": "https://youtu.be/uHyfQV0kbgo",
                        "created_at": "2025-03-09T02:19:07.000000Z",
                        "updated_at": "2025-03-09T02:19:07.000000Z"
                    }
                ]
            }
        }
    }
    
  • Response Gagal
    {
        "status": "fail",
        "message": "Data tidak valid",
        "data": {
            "field": [
                "Pesan validasi"
            ]
        }
    }
    

Delete Link Tree

Menghapus halaman link tree beserta seluruh item tautannya.

  • URL
    • /link-trees/:id
  • Method
    • DELETE
  • Headers
    • Authorization: Bearer <token>
  • Contoh Request
    DELETE {{BaseURL}}/link-trees/1
    Accept: application/json
    Authorization: Bearer <token>
    
  • Response Berhasil
    {
        "status": "success",
        "message": "Berhasil menghapus data"
    }
    
  • Response Gagal
    {
        "status": "fail",
        "message": "Data tidak valid",
        "data": {
            "field": [
                "Pesan validasi"
            ]
        }
    }
    

Add New Link Tree Item

Menambahkan tautan baru ke dalam halaman link tree.

  • URL
    • /link-trees/:link_tree_id/items
  • Method
    • POST
  • Headers
    • Content-Type: application/json
    • Authorization: Bearer <token>
  • Request Body
    • title as string
    • url as url
  • Contoh Request
    POST {{BaseURL}}/link-trees/1/items
    Accept: application/json
    Authorization: Bearer <token>
    Content-Type: application/json
    
    {
        "title": "Contoh Judul",
        "url": "https://delcom.org"
    }
    
  • Response Berhasil
    {
        "status": "success",
        "message": "Berhasil menambahkan data",
        "data": {
            "item_id": 1
        }
    }
    
  • Response Gagal
    {
        "status": "fail",
        "message": "Data tidak valid",
        "data": {
            "field": [
                "Pesan validasi"
            ]
        }
    }
    

Update Link Tree Item

Memperbarui label judul atau alamat URL dari tautan link tree.

  • URL
    • /link-trees/:link_tree_id/items/:id
  • Method
    • PUT
  • Headers
    • Content-Type: application/json
    • Authorization: Bearer <token>
  • Request Body
    • title as string
    • url as url
  • Contoh Request
    PUT {{BaseURL}}/link-trees/1/items/1
    Accept: application/json
    Authorization: Bearer <token>
    Content-Type: application/json
    
    {
        "title": "Contoh Judul",
        "url": "https://delcom.org"
    }
    
  • Response Berhasil
    {
        "status": "success",
        "message": "Berhasil mengubah data"
    }
    
  • Response Gagal
    {
        "status": "fail",
        "message": "Data tidak valid",
        "data": {
            "field": [
                "Pesan validasi"
            ]
        }
    }
    

Delete Link Tree Item

Menghapus tautan tertentu dari daftar link tree.

  • URL
    • /link-trees/:link_tree_id/items/:id
  • Method
    • DELETE
  • Headers
    • Authorization: Bearer <token>
  • Contoh Request
    DELETE {{BaseURL}}/link-trees/1/items/1
    Accept: application/json
    Authorization: Bearer <token>
    
  • Response Berhasil
    {
        "status": "success",
        "message": "Berhasil menghapus data"
    }
    
  • Response Gagal
    {
        "status": "fail",
        "message": "Data tidak valid",
        "data": {
            "field": [
                "Pesan validasi"
            ]
        }
    }
    

Delete All Link Trees

Menghapus semua data link tree milik pengguna saat ini secara permanen beserta cover dan item tautan di dalamnya.

  • URL
    • /link-trees
  • Method
    • DELETE
  • Headers
    • Authorization: Bearer <token>
  • Contoh Request
    DELETE {{BaseURL}}/link-trees
    Accept: application/json
    Authorization: Bearer <token>
    
  • Response Berhasil
    {
        "status": "success",
        "message": "Berhasil menghapus semua data link tree"
    }
    
  • Response Gagal
    {
        "status": "fail",
        "message": "Unauthenticated."
    }