Sistem API

API sistem kami hadir untuk menyederhanakan pengelolaan perangkat Anda. Anda tidak perlu lagi masuk ke aplikasi WHAPI untuk melihat, menghapus, menambah, atau mengubah Kunci API (API Key). Semua bisa Anda lakukan dengan cepat dan efisien, langsung dari sistem Anda.

listDevice

get

Menampilkan seluruh device

Body
secretstringOptionalExample: api_key_sistem
Responses
200
Response 200
application/json
get
GET /api/listDevice HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 27

"secret='api_key_sistem'"
200

Response 200

{
  "data": [
    {
      "apiKey": "xxxxx",
      "id": "xxxxx",
      "name": "xxxxx",
      "settings": {
        "autoreply_status": false,
        "autostartdevice_status": false,
        "downtimenotif_status": false,
        "restoresession_status": true,
        "webhook_status": false,
        "webhookmedia_status": false
      },
      "state_status": "SERVICE_OFF",
      "telegram": {
        "idTelegram": "",
        "tele_push_changestate": true,
        "tele_push_connect": true,
        "tele_push_disconnect": true,
        "tele_push_reminderlicense": true
      },
      "webhook": {
        "urlWebhook": ""
      }
    }
  ],
  "status": true
}

addDevice

post

Menambah device

Body
namestringOptionalExample: Device from API
secretstringOptionalExample: api_key_sistem
Responses
200
Response 200
application/json
post
POST /api/addDevice HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 52

"name='Device from API'&secret='api_key_sistem'"
200

Response 200

{
  "message": "Device successfully added",
  "status": true
}

editDevice

post

Mengubah device

Body
namestringOptionalExample: Device from API
secretstringOptionalExample: api_key_sistem
Responses
200
Response 200
application/json
post
POST /api/editDevice HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 52

"name='Device from API'&secret='api_key_sistem'"
200

Response 200

{
  "message": "Device successfully updated",
  "status": true
}

detailDevice

post

Melihat detail device

Body
idstringOptionalExample: id_device
secretstringOptionalExample: api_key_sistem
Responses
200
Response 200
application/json
post
POST /api/detailDevice HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 44

"id='id_device'&secret='api_key_sistem'"
200

Response 200

{
  "data": {
    "apiKey": "xxxxx",
    "id": "xxxxx",
    "name": "xxxxx",
    "settings": {
      "autoreply_status": false,
      "autostartdevice_status": false,
      "downtimenotif_status": false,
      "restoresession_status": true,
      "webhook_status": false,
      "webhookmedia_status": false
    },
    "state_status": "SERVICE_OFF",
    "telegram": {
      "idTelegram": "",
      "tele_push_changestate": true,
      "tele_push_connect": true,
      "tele_push_disconnect": true,
      "tele_push_reminderlicense": true
    },
    "webhook": {
      "urlWebhook": ""
    }
  },
  "status": true
}

changeApiKey

post

Ubah API Key Device untuk mengakses API Whatsapp

Body
idstringOptionalExample: id_device
secretstringOptionalExample: api_key_sistem
Responses
200
Response 200
application/json
post
POST /api/changeApiKey HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 44

"id='id_device'&secret='api_key_sistem'"
200

Response 200

{
  "data": {
    "apiKey": "xxxxx"
  },
  "message": "Your API Key updated successfully",
  "status": true
}

deleteDevice

post

Hapus device

Body
idstringOptionalExample: id_device
secretstringOptionalExample: api_key_sistem
Responses
200
Response 200
application/json
post
POST /api/deleteDevice HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 44

"id='id_device'&secret='api_key_sistem'"
200

Response 200

{
  "message": "Device deleted successfully",
  "status": true
}