This is a Example App to do an integration with an example API:
Host: http://ec2-52-45-26-25.compute-1.amazonaws.com:5050
Namespace: dev
Endpoint: hotels/:hotel_id/rooms/:rate_token
Example of request: http://ec2-52-45-26-25.compute-1.amazonaws.com:5050/dev/hotels/36124539/rooms/PGhvdDpyYXRlVG9rZW4geG1sbnM6aG90PSJodHRwOi8vY3ZjLmNvbS5ici9tb2RlbC9ob3RlbHMiIHBsYT0iMzYiIGNtaT0iMzYiIGNtYz0iMzYwMDEiIHJ0az0iZDM5MWEyNzktMzlkNC00MDAxLThjYzctMjMzZmEzM2ZmOWFlLTUwMDMiIHJ0cD0iNDgyMDQwIiBydGM9IjIwNDc3ODc1NSIgY2hhPSI3NzUuNjAiIG5hZD0iMSIgYmV0PSIxMyIgY3VyPSJCUkwiIGl6bz0iMzM4MzAiIGFncz0iVyIgYnJjPSIxMDAwIiBsYW49InB0X0JSIiBkaW49IjIwMTYtMTAtMjgiIGRvdT0iMjAxNi0xMC0yOSIgcGtnPSJWSEkiIHB4cz0iMzAiLz4=
The request should send the headers:
Gtw-Sec-User-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjcmVkZW50aWFsIjp7InBlcnNvbklkIjo3NjI3ODY1LCJ1c2VySWQiOjk2NzExLCJuYW1lIjoiVElNRSIsImNwZiI6IjQxMDUyOTY0ODUwIiwiYnJhbmNoSWQiOjEwMDAsImFnZW50U2lnbiI6IlciLCJ1c2VyIjoiTVRaQ1BENjAwIn0sInN5c3RlbXMiOlt7InN5c3RlbUNvZGUiOjEsImNsaWVudElEIjo3MTEyOTk0NDY3Mzg4NTkwLCJleHBpcmVzT24iOiIyMDE2LTA3LTA2VDIwOjU4OjQ4LjAwMC0wMzowMCIsImFjdGl2ZSI6IlMgIn0seyJzeXN0ZW1Db2RlIjozLCJjbGllbnRJRCI6NzExMjk5NDQ2NzM4ODU5MSwiZXhwaXJlc09uIjoiMjAxNi0wNy0wNlQyMDoxMzo0OC4wMDAtMDM6MDAiLCJhY3RpdmUiOiJTICJ9XSwiaWF0IjoxNDY3ODQ1OTI2fQ.UJ-ijCm_fjTgSwoTQ4JgVn4hyQrQYWQfFIWzJZUwCT0
Gtw-Transaction-Id: 1234567890
-
Fork this project, configure the adapter os application, setup the model and routes to do a
GET
on our API. -
What we want to see done is a way to trigger the
get
by user for the provided endpoint. The user should have a way to specify bothhotel_id
andrate_token
. -
Please take into account that this is just a single endpoint in a very big application with many other endpoints present and the api address, specifically
http://ec2-52-45-26-25.compute-1.amazonaws.com:5050
would be changed in the future. Try to take this into account when implementing the test-task. -
The
room
model primary key israteToken
inside therates
array. Please assume that for every room the relatedrateToken
which is primary key is the first one in the array. Implement the adapter/serializer/model in such way that the primary key for room is set correctly on data fetch.
After that, commit in a public repository. Send the link to us.
Good lucky!