GeoNetAgent, LDAPWeb, server-audit, server-connection
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1.7 KiB

Format Response Standar

Semua response API geonet-console menggunakan format JSON konsisten.


Response Sukses — Single Resource

{
    "data": {
        "id": "uuid",
        "field": "value"
    }
}

Response Sukses — Collection

{
    "data": [
        { "id": "uuid-1", "field": "value" },
        { "id": "uuid-2", "field": "value" }
    ]
}

Response Sukses — Action (revoke, delete, dll.)

{
    "message": "Operasi berhasil."
}

Response Sukses — Create (dengan token sekali tampil)

{
    "data": {
        "id": "uuid",
        "token": "plain_token_hanya_tampil_sekali",
        "token_prefix": "Col5FUFl34dVXgyB"
    },
    "message": "Token created. Save it now — it will not be shown again."
}

Response Error

{
    "error": {
        "code": "ERROR_CODE",
        "message": "Deskripsi error yang dapat dibaca manusia."
    }
}

Response Error — Validation

{
    "message": "The given data was invalid.",
    "errors": {
        "name": ["The name field is required."],
        "service": ["The service field is required."]
    }
}

HTTP Status Codes

Code Kondisi
200 OK — request berhasil
201 Created — resource baru dibuat
204 No Content — delete berhasil
400 Bad Request — request tidak valid
401 Unauthorized — tidak ada / token invalid
403 Forbidden — token valid tapi tidak punya akses
404 Not Found — resource tidak ditemukan
422 Unprocessable Entity — validasi gagal
429 Too Many Requests — rate limit
500 Internal Server Error — error server