## Get Members

### cURL

```
curl --request GET \
  --url https://vanilla-dev02-loyalty.fabric.zone/api/v1/members \
  --header 'Authorization: Bearer <token>'
```

### Python

```
import requests

url = "https://vanilla-dev02-loyalty.fabric.zone/api/v1/members"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

### JavaScript

```
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://vanilla-dev02-loyalty.fabric.zone/api/v1/members', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### PHP

```
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://vanilla-dev02-loyalty.fabric.zone/api/v1/members",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

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

curl_close($curl);

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

### Go

```
package main

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

func main() {

url := "https://vanilla-dev02-loyalty.fabric.zone/api/v1/members"

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

req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))
}
```

### Unirest (Java)

```
HttpResponse<String> response = Unirest.get("https://vanilla-dev02-loyalty.fabric.zone/api/v1/members")
  .header("Authorization", "Bearer <token>")
  .asString();
```

### Ruby

```
require 'uri'
require 'net/http'

url = URI("https://vanilla-dev02-loyalty.fabric.zone/api/v1/members")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

### Response Example
200

```
{
  "message": "Result of requested Members",
  "errors": {},
  "data": {
    "accounts": [
      {
        "accountStatus": "Enabled",
        "clubReference": "abc_club",
        "clubTitle": "ABC Club",
        "customAttributes": {
          "memberSinceDate": "2021-07-26",
          "enrolledAtCenter": "Liberty Store",
          "profileCompleted": false
        },
        "enrollmentEntity": "demo",
        "enrollmentStatus": true,
        "entityReference": "entity_level_1",
        "loyaltyNumber": "10000147371",
        "paidStatus": false,
        "profileId": "f90a1da5-c072-48b7-a9ea-eb35c5dd506b",
        "redemptionChoice": "Auto",
        "redemptionThreshold": 10,
        "tierExpiryDate": "2022-09-17T14:26:32.192148+00:00",
        "tierExternalReference": "GLD",
        "tierId": 4185,
        "tierTitle": "ClubTier",
        "updatedAt": "2021-11-01 12:15:53.831401+00:00"
      }
    ],
    "addressLine1": "10400 NE 4th St",
    "addressLine2": "Suite 505",
    "addressLine3": "",
    "birthdate": "1990-11-16",
    "channelExternalReference": "Web",
    "city": "Austin",
    "country": "US",
    "emailAddress": "user@abc.com",
    "enrollReasonCode": "1234",
    "enrollReasonNote": "Guest",
    "enrollmentTimestamp": "2021-09-14T11:32:55.508949Z",
    "firstName": "John",
    "fullCountry": "United States",
    "fullRegion": "Texas",
    "gender": "Male",
    "lastName": "Wayne",
    "middleName": "Duke",
    "nationality": "",
    "phoneNumber": "923331234567",
    "postalCode": "98004",
    "prefix": "Mr",
    "region": "TX",
    "sourceExternalReference": "www.abcdemo.com",
    "suffix": "<string>"
  },
  "status": 200
}
```

### Error Response Example
400

```
{
  "message": "Error message string",
  "errors": {
    "ExceptionString": [
      "Invalid Field"
    ]
  },
  "data": null,
  "status": 400
}
```

```
{
  "detail": "Authentication Failed"
}
```

### Authorizations

**Authorization**  
string  
header  
required  
Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.

### Query Parameters

- **loyaltyNumber** : string - Loyalty number of the member. Either the loyaltyNumber or the profileId must be specified.
- **profileId** : string - Profile ID of the member. Either the loyaltyNumber or the profileId must be specified.
- **redemptionChoice** : string - Redemption choice. Supported options are Bank and Auto.
- **firstName** : string - First name of member
- **middleName** : string - Middle name of member
- **lastName** : string - Last name of member
- **phonenumber** : string - Phone number given for enrollment (without space or dash)
- **email** : string - Email address given for enrollment
- **address** : string - Address of member
- **postalCode** : string - Postal code of address
- **city** : string - City name
- **countryName** : string - Country name
- **countryAbbreviation** : string - Abbreviation of country name
- **regionName** : string - State name
- **regionAbbreviation** : string - Abbreviation of state name
- **offset** : integer - Starting number of record in the response.
- **limit** : integer - Ending number of record in the response.
