This endpoint allows you to check if the user's name/email address is registered with ZexPay.io, this can be used as validation before calling the "Send Payment" endpoint on your faucet platform.
GEThttps://zexpay.io/api/v1/get-user/| Name | Required | Type | Info |
|---|---|---|---|
| user | Yes | String | A registered username or email address. |
Example<?php $api_key = 'YOUR_FAUCET_API_KEY'; $data = '?'.http_build_query(['user' => 'username01']); $url = 'https://zexpay.io/api/v1/get-user/'.$data; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'api-key: '.$api_key ]); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $response = curl_exec($ch); $result = json_decode($response, true); var_dump($result); ?>
These example code snippets demonstrate how to request the "Validate User" endpoint using PHP cURL. You can customize the data parameters according to your specific requirements. And below is the response you will receive:
Success Response{ "status" : 200, "error" : false, "message" : "ok", "data" : { "user" : "username01" } }
Below is a list of status from this endpoint. This can be a validation material for your website:
| Status | Error | Data | Message |
|---|---|---|---|
| 200 | false | Object | The request was processed without errors. |
| 400 | true | null | Required fields is missing or User is not registered in ZexPay.io. |
| 401 | true | null | Invalid / missing API Key, User found but blocked by this API Key profile, or User found but not active. |
| 405 | true | null | Method not allowed, API Key profile restricts public access, or API Key profile has been banned. |
Error Response{ "status" : 400, "error" : true, "message" : "User is not registered in ZexPay.io.", "data" : null }
