Flexigift Service API

Get Users

The Get Users service returns an array of the users in the system along with their details.

URL

{base_url}/users

HTTP method

GET

Request headers

None

Request parameters

None

Request data

None

Response data

Name Type Mandatory? Constraints Notes
id int yes Must be unique. Internal unique ID generated by the system.
user_id string yes Must be unique. Unique ID.
amazon_id string yes - The user’s Amazon account ID.
name string yes - The user’s full name.
email string yes Must contain an ‘@’ symbol. The user’s email address.
gift_cards string[] yes - Array of gift cards associated with the user.

HTTP response codes

Code Description Notes
200 OK -

Example requests and responses

Get all Users

Request:

curl http://localhost:3000/users

Response:

[
  {
    "id": 1,
    "user_id": "user001",
    "amazon_id": "amz12345",
    "name": "John Doe",
    "email": "john.doe@example.com",
    "gift_cards": [
      "hanes-gc-001",
      "nike-gc-002"
    ]
  },
  {
    "id": 2,
    "user_id": "user002",
    "amazon_id": "amz67890",
    "name": "Jane Smith",
    "email": "jane.smith@example.com",
    "gift_cards": [
      "starbucks-gc-003"
    ]
  },
  {
    "id": 3,
    "user_id": "user003",
    "amazon_id": "amz54321",
    "name": "Alice Johnson",
    "email": "alice.johnson@example.com",
    "gift_cards": [
      "gap-gc-004",
      "nike-gc-002"
    ]
  },
  {
    "id": 4,
    "user_id": "user004",
    "amazon_id": "amz98765",
    "name": "Bob Brown",
    "email": "bob.brown@example.com",
    "gift_cards": [
      "hanes-gc-001"
    ]
  }
]