# Authenticate

Authenticate User

## Endpoint => /user/authenticate

<mark style="color:green;">`POST`</mark> `/`user/`authenticate`

An admin credentials will be created and shared with you once your organization has been onboarded on our portal and all KYC activities has been.

#### Request Body

| Name                                       | Type   | Description   |
| ------------------------------------------ | ------ | ------------- |
| user\_id<mark style="color:red;">\*</mark> | String | User Id       |
| password<mark style="color:red;">\*</mark> | String | User Password |

{% tabs %}
{% tab title="200 Success" %}
{% code fullWidth="true" %}

```javascript
{
  "status": "Success",
  "description": "Login Successfull",
  "authDetails": {
    "authToken": "PBKWY4APEAQD83FBU9GZK37NGH11SUNH-168",
    "expireToken": "2023-01-27 05:06:08"
  },
  "userDetails": {
    "userID": "G-4568-3493",
    "Full Name": "King One Admin",
    "Username": "kingOneAdmin"
  },
  "orgDetails": {
    "secret-key": "T2Y629UUeiwe7fjdj838934ooosoi82398297297482992",
    "Org Full Name": "King One Enterprise"
  }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

<pre class="language-php" data-full-width="false"><code class="lang-php"><strong>&#x3C;?php
</strong>
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://apisandbox.fezdelivery.co/v1/user/authenticate',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "user_id": "G-4568-3493",
    "password":"KingOne123#"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

</code></pre>

{% hint style="info" %}
**Good to know:** Upon a successful login, the API returns the user details and the authentication details which contain your bearer token and the token's expiry date.

Please use the bearer token when making calls to other method. Also, please include secret-key in your header. The secret key identify your organization
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fez-delivery-co.gitbook.io/fezcorporate-api-docs/api-endpoints/auth/authenticate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
