- API Endpoint: https://dev.xola.com/api
- Documentation: https://dev.xola.com/api/doc
New accounts are created via a POST request to the users API end point. The email address should be a valid address that will receive a confirmation email.
curl -H "Content-type: application/json" -X POST https://dev.xola.com/api/users -d '{
"name" : "John Doe",
"email" : "john.doe@gmail.com",
"password" : "password123",
"roles" : ["ROLE_DEVELOPER"]
}'
IMPORTANT: Once the account is created, click on the activation link in the email to proceed ahead
Grab your user account ID and check up on your roles. Make note of your user id, as that will be used to get your API Key
curl -H "Content-type: application/json" https://dev.xola.com/api/users/me -u "john.doe@gmail.com:password123"
curl -H "Content-type: application/json" https://dev.xola.com/api/users/<my_user_id>/apiKey -u "john.doe@gmail.com:password123"
All future requests don't need username password. You can use the API Key, for example - getting your user info
curl -H 'X-API-KEY: MYRANDOMLYGENERATEDAPIKEYGOESHERE' -H 'Content-type: application/json' https://dev.xola.com/api/users/me
Fetching all experiences requires an authenticated user
curl -H 'X-API-KEY: MYRANDOMLYGENERATEDAPIKEYGOESHERE' -H 'Content-type: application/json' https://dev.xola.com/api/experiences
No auth required for fetching information about a specific experience
curl -H 'Content-type: application/json' https://dev.xola.com/api/experiences/4f358f70536e86b149000000
To create an order you can use the POST /api/orders
endpoint.
curl -X POST https://dev.xola.com/api/orders -H 'X-API-KEY: MYRANDOMLYGENERATEDAPIKEYGOESHERE' -H 'Content-type: application/json' -d '{
"source" : "office",
"status" : 100,
"experienceName" : "Hiking in California Wine Country",
"quantity" : 2,
"experience" : {
"id" : "4f358f70536e86b149000000"
},
"arrival" : "2013-09-22",
"price" : 2300,
"priceType" : "person",
"guestType" : "normal",
"customerName" : "Josh Lyman",
"customerEmail" : "josh.lyman@mailinator.com",
"currency" : "USD",
"payment" : {
"method" : "cash",
"comment" : "This guy loves hiking, is a repeat customer"
}
}'
Refer to the detailed documentation at https://dev.xola.com/api/doc to prepare & create orders.
Postman Rest Client - A Google Chrome extension to help you create API requests.
Firefox REST Client - A Firefox add-on to help you create API requests
Curl request to send a JSON request through an input file
curl -X POST -d @input.json https://dev.xola.com/api/users
View Response headers including the status code
curl -i https://dev.xola.com/api/experiences
Curlish - A nice wrapper over Curl to ease some tedious tasks
More curl tips - https://httpkit.com/resources/HTTP-from-the-Command-Line/