Booking Agent (p:booking-agent)

http//profiles.goabout.com/booking-agent

The Booking Agent resource enables the client to create Reservation (p:reservation) resources, for the User.

A Reservation (p:reservation) can only be made for a specific TripLeg (p:trip-leg) using a Subscription (p:subscription) for a Product (p:product) that provides access to the Mode used for the TripLeg (p:trip-leg).

Example

$ curl -v -d'{
   "tripLegHref":"https://api.goabout.com/trip-leg/1430",
   "subscriptionHref":"https://api.goabout.com/subscription/561",
   "properties": {
     "phonenumber": "+31 6 1234 5678",
     "cardnumber": "2257998-73"
   }
}' -H'Authorization: Bearer UArtDY9Bpo9Whga2mfd7nIK6vENxp2twtnH7RvPC6xj0jy6' -H'Content-Type: application/json' 'https://api.goabout.com/booking-agent'
[ SSL HANDSHAKE CUT OUT ]
> POST /booking-agent HTTP/1.1
> Host: api.goabout.com
> User-Agent: curl/7.32.0
> Accept: */*
> Authorization: Bearer UArtDY9Bpo9Whga2mfd7nIK6vENxp2twtnH7RvPC6xj0jy6
>
< HTTP/1.1 201 CREATED
< Server: nginx/1.4.4
< Location: /reservation/16
< Date: Fri, 20 Dec 2013 11:06:33 GMT
< Content-Type: application/json
< Content-Length: 476
< Connection: keep-alive
< Cache-Control: private, no-cache, no-storage
{
  "destinationHref" : "https://api.goabout.com/location/address/bac9b24d",
  "_links": {
    "properties" {
      "phonenumber": "+31 6 1234 5678",
      "cardnumber": "2257998-73"
    },
    "self" : {
      "href" : "https://api.goabout.com/reservation/16"
    },
    "http://rels.goabout.com/subscription" : {
      "href" : "https://api.goabout.com/subscription/561"
    },
    "http://rels.goabout.com/trip-leg" : {
      "href" : "https://api.goabout.com/trip-leg/1430"
    }
  }
}

Reference

POST

When posting to this resource, a new Reservation (p:reservation) will be created for the User, using a certain Subscription (p:subscription).

After a reservation is made, the party (or parties) responsible for providing the service will be notified of the reservation.

The profile of resource returned is Reservation (p:reservation).

Properties

tripLegHref:URI [OPTIONAL] The href for the trip-leg to make the reservation for.
subscriptionHref:
 URI The href for the subscription to use.
properties:JSON-Object A JSON-Object containing JSON-Values that will validate against the JSON-Schema provided with the Product that is being used to make this reservation

Danger

The properties object is a bit magical. We’ll try to keep the magic at a minimum.

Special properties
departureHref:URI If this property is defined in the schema, it should be filled with the self-href to the departureLocation of the context-TripLeg.
arrivalHref:URI If this property is defined in the schema, it should be filled with the self-href to the arrivalLocation of the context-TripLeg.
departureDateTime:
 DateTime If this property is defined in the schema, it should be filled with the departureTime of the context-TripLeg .