Exposes an API with functionality to:
-
Receive API calls from
Tenbew Gateway
app -
Processes SOAP integration logic to
DOI
API -
Handle / return downstream logic back to GATEWAY
- Make sure you have
Ruby
installed, following are compatible versions:- Ruby >= 2.5.3
- Rails >= 5.2.3
- Clone the project with
git clone [email protected]:brandonleetruter/tenbew_doi_api.git
- Install bundler
gem install bundler
, move to appcd tenbew_doi_api
and install gemsbundle install
- Create and migrate database with
bin/rake db:setup
- Start Server with
bin/rails s
Now we can response to API requests on localhost:3000
POST /subscriptions
$ curl --request POST \
--url 'http://localhost:3000/api/v1/subscriptions' \
--header 'Content-Type: application/json; charset=utf-8' \
--data $'{ "msisdn": "27124247232", "state": "active", "message": "first subscription", "service": "none", "reference": "test" }'
Response:
{
"id":1,"state":"active","service":"none","msisdn":"27124247232","message":"first subscription","reference":"test"
}
GET /subscriptions
$ curl --request GET \
--url 'http://localhost:3000/api/v1/subscriptions' \
--header 'Content-Type: application/json'
Response:
[{"id":1,"state":"active","service":"none","msisdn":"27124247232","message":"first subscription","reference":"test"}]
GET /subscriptions/:id
$ curl --request GET \
--url 'http://localhost:3000/api/v1/subscriptions/1' \
--header 'Content-Type: application/json'
Response:
{
"id":1,"state":"active","service":"none","msisdn":"27124247232","message":"first subscription","reference":"test"
}