Салбарын жагсаалт
Тухайн салбарт харьяалагдах салбаруудын жагсаалт
Харяа салбарууд авах хүсэлт:
METHOD | URL | HEADER |
GET | /api/w/branches | content-type: application/x-www-form-urlencoded x-and-auth-token: {Token} |
Response
Нэр | Төрөл | Тайлбар |
code | Integer | Хариу код 0 - амжилттай эсвэл алдааны код |
response | Mixed | Хэрвээ алдаа гарсан тохиолдолд алдааны тайлбар байна. Амжилттай бол дэлгэрэнгүй мэдээлэл. |
Response-ын дэлгэрэнгүй
Хүсэлт илгээж буй жишээ:
curl -X GET \
'https://mgw.test.lending.mn/api/w/branches' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'x-and-auth-token: {token}'
Амжилттай болсон хариу
{
"code": 0,
"response": [
{
"name": "Branch name",
"walletNumber": "xxxxxxx",
"children": [
{
"name": "Sub Branch name 1",
"walletNumber": "xxxxxxx",
"children": [ ]
},
{
"name": "Sub Branch name 2",
"walletNumber": "xxxxxxx",
"children": [ ]
}
]
}
]
}
Амжилтгүй болсон хариу
{
"code": 400,
"response": {
"error": "invalid_client",
"error_description": "The client credentials are invalid"
}
}