Hesap Bilgilerini Getir
Açıklama
Section titled “Açıklama” GET
/v1/accounts/0 Belirtilen ID'ye sahip kullanıcının hesap ve profil detaylarını döndürür.
Parametreler
Section titled “Parametreler”| Parametre | Konum | Tip | Açıklama | Varsayılan | Örnek |
|---|---|---|---|---|---|
| Authorization * | header | string | Bearer Yetkilendirme Tokeni (Örn: Bearer eyJhb...) | - | Bearer <TOKEN> |
| userID * | path | string | İşlem yapan kullanıcının ID'si. | - | - |
Örnek Kod
Section titled “Örnek Kod”fetch('https://api.kargomucuz.com/v1/accounts/0', { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <YOUR_TOKEN>' }}).then(response => response.json()).then(data => console.log(data));$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.kargomucuz.com/v1/accounts/0');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$headers = array();$headers[] = 'Content-Type: application/json';$headers[] = 'Authorization: Bearer <YOUR_TOKEN>';curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);if (curl_errno($ch)) { echo 'Error:' . curl_error($ch);}curl_close($ch);echo $result;Yanıtlar
Section titled “Yanıtlar”200: Kimlik doğrulaması başarılı olduğunda dönen yanıt.
{ "status": true, "message": "Kullanıcı hesabı getirildi.", "payload": { "data": { "wallet": { "try": { "currency": "try", "balance": 6003.08, "debt": 0, "provision": 0 }, "usd": { "currency": "usd", "balance": 0, "debt": 0 }, "eur": { "currency": "eur", "balance": 0, "debt": 0 } }, "others": { "updated": "2024-10-12T13:59:26.204Z", "created": "2024-10-12T13:59:26.204Z" }, "resellerId": null, "_id": "670a80beba9b41f347291c96", "users": [ { "private": { "ID": "x-096f889c-a55a-4c05-a347-f58bd4706bcc-u" }, "others": { "bankAccountAd": null, "verify": { "platformProvisionAgreement": false, "certificateOfResidence": false, "electronicConfirmationText": true, "userAgreement": true, "general": false }, "postalCheck": null, "lastLogin": null, "isActive": false, "blocked": false, "updated": "2024-10-12T13:59:26.115Z", "created": "2024-10-12T13:59:26.115Z" }, "resellerId": null, "_id": "670a80beba9b41f347291c90", "type": "individual", "role": "member", "name": "yasir", "surname": "kaygusuz", "date": { "day": 24, "month": 5, "year": 2004 }, "gender": "male", "username": "y.yasir.k", "email": "yasoka@gmail.com", "password": "$2b$10$QNBaneZAosgt/wQm/6aEnO7oub6fkwnJzJ/gdPITG6dfkhUPq.LcK", "phone": { "phoneCountryCode": "90", "number": "541000000" }, "profilePhotoURI": "67d28672351039eef56ed7af", "IBAN": null, "credentials": [ { "type": "tr", "number": "59788322262", "name": "Yasir", "surname": "KAYGUSUZ", "verify": true, "date": { "day": 24, "month": 5, "year": 2004 } } ], "passports": [], "__v": 0, "pricingSettings": [] } ], "__v": 0 }, "totalCount": 1 }, "code": 500}401: Kimlik doğrulaması (token) olmadan istek gönderildiğinde dönen yetkisiz erişim yanıtı.
{ "status": false, "message": "Giriş sağlanmadı.", "code": 500}