Agents

This resource represents the profile of an individual working for a travel agency. All bookings are associated with an agent.

XML Schema:

GET:

PATCH:

Fields

Name Type Description
id read-only String  
href read-only Field  
role read-only Nested Object The role of this agent.
  • id read-only
String  
  • name required
String The name of this role.
first_name String The first name of this agent.
last_name String The last name of this agent.
email required String The email of this agent.
phone_numbers Field The phone numbers for this agent.
  • number required
String The number for this phone number.
  • type required
String The type of this phone number.
username String The username of this agent.
agency read-only Reference Object The agency this agent works for.
active Boolean Flag to indicate if the agent is active.

Get an Agent

GET /agents/(string: agent_id)/

Update an Agent

PATCH /agents/(string: agent_id)/

Example Request:

PATCH /agents/1234/ HTTP/1.1
Host: rest.gadventures.com
Accept: application/json
Content-Type: application/json
{
    "first_name": "Foo",
    "last_name": "Bar",
    "email": "foo.bar@gadventures.com",
    "phone_numbers": [
        {
            "number": "123 4567",
            "type": "Work"
        }
    ],
    "username": "foo.bar"
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "active": True,
    "agency": {
        "href": "/agents/999",
        "id": 999,
    },
    "email": "foo.bar@gadventures.com",
    "first_name": "Foo",
    "href": "/agents/1234",
    "id": 1234,
    "last_name": "Bar",
    "phone_numbers": [
        {
            "number": "123 4567",
            "type": 'Work'
        }
    ],
    "role": {
        "id': "1",
        "name": "Agency User"
    },
    "username": "foo.bar"
}