> For the complete documentation index, see [llms.txt](https://docs.mnasati.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mnasati.com/api-methods/customer-list.md).

# Customer List

## List customers

<mark style="color:green;">`POST`</mark> `https://sandbox.mnasati.com/v1/customers`

This endpoint allows you to list all customers.

#### Headers

| Name         | Type   | Description                                      |
| ------------ | ------ | ------------------------------------------------ |
| Content-Type | string | Application/JSON                                 |
| Access Token | string | JWT Access Token from the authorization method.. |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
   "status":true,
   "total":"78",
   "data":[
      {
         "customer_id":"78",
         "name":"john",
         "phone":"966431424",
         "email":"johnd11@gmail.com",
         "registeration_date":"2021-05-17 10:03:57"
      },
      {
         "customer_id":"77",
         "name":"tttttttt",
         "phone":"97499999999966",
         "email":"test@test.com",
         "registeration_date":"2021-04-22 06:42:51"
      },
      {
         "customer_id":"76",
         "name":"odeh33333333",
         "phone":"97499944222",
         "email":"odeh3333333@uigtc.com",
         "registeration_date":"2021-04-07 10:44:00"
      },
      {
         "customer_id":"75",
         "name":"vuvuuvvyyv",
         "phone":"9749991144",
         "email":"pppppp@uigtc.com",
         "registeration_date":"2021-04-05 21:33:33"
      },
      {
         "customer_id":"74",
         "name":"ghhhhu",
         "phone":"97499922211",
         "email":"yyyyyy@uigtc.com",
         "registeration_date":"2021-04-05 21:32:33"
      },
      {
         "customer_id":"73",
         "name":"odeh",
         "phone":"97499966611",
         "email":"odehtest@uigtc.com",
         "registeration_date":"2021-04-05 19:12:40"
      },
      {
         "customer_id":"72",
         "name":"Qasem",
         "phone":"97499009060",
         "email":"jeya22@uigtc.com",
         "registeration_date":"2021-03-30 15:56:48"
      },
      {
         "customer_id":"71",
         "name":"john",
         "phone":"966441424",
         "email":"john@gmail.com",
         "registeration_date":"2021-03-25 11:18:02"
      },
      {
         "customer_id":"70",
         "name":"Bayan",
         "phone":"96594476503",
         "email":"bayan.darwish@uigtc.com",
         "registeration_date":"2021-03-24 13:52:03"
      },
      {
         "customer_id":"69",
         "name":"jack",
         "phone":"974962799101921",
         "email":"j.abbadi@uigtc.com",
         "registeration_date":"2021-03-24 13:20:06"
      }
   ]
}
```

{% endtab %}

{% tab title="404 " %}

```
{    "message": "Not Found."}
```

{% endtab %}
{% endtabs %}

## Examples

{% tabs %}
{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("sandbox.mnasati.com")

headers = {
    'Content-Type': "",
    'Authorization-Jwt': ""
    }

conn.request("POST", "/v1/customers", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://sandbox.mnasati.com/v1/customers",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Authorization-Jwt: ",
    "Content-Type: "
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://sandbox.mnasati.com/v1/customers")
  .post(null)
  .addHeader("Content-Type", "")
  .addHeader("Authorization-Jwt", "")
  .build();

Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("https://sandbox.mnasati.com/v1/customers"),
    Headers =
    {
        { "Content-Type", "" },
        { "Authorization-Jwt", "" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.mnasati.com/v1/customers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = ''
request["Authorization-Jwt"] = ''

response = http.request(request)
puts response.read_body
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://sandbox.mnasati.com/v1/customers"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Content-Type", "")
	req.Header.Add("Authorization-Jwt", "")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

{% endtab %}

{% tab title="Swift" %}

```swift
import Foundation

let headers = [
  "Content-Type": "",
  "Authorization-Jwt": ""
]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.mnasati.com/v1/customers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

{% endtab %}

{% tab title="jQuery" %}

```javascript
const settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://sandbox.mnasati.com/v1/customers",
  "method": "POST",
  "headers": {
    "Content-Type": "",
    "Authorization-Jwt": ""
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

{% endtab %}
{% endtabs %}
