Getting Started with Anypoint Platform (SP) - Snippets
* MODULE 1 **********************************************************
* APIS.guru
https://apis.guru/
* MuleSoft Training API portal:
https://anypoint.mulesoft.com/exchange/portals/muletraining/
* American Flights web service
http://mu.mule-training.com/american-ws/flights
* American Flights API post body
{
"code": "GQ574",
"price": 399,
"departureDate": "2016/12/20",
"origin": "ORD",
"destination": "SFO",
"emptySeats": 200,
"plane": {"type": "Boeing 747", "totalSeats": 400}
}
* American Flights API
http://mu.mule-training.com/american/flights
* American Flights API client_id for APDev fictitious application
c05ddced9f1442a5b4f46335b810f2f1
* American Flights API client_secret for APDev fictitious application
D86c96AC942346Ccb51D50B00ED5a4B4
* MODULE 3 **********************************************************
* American Flights API description text
The American Flights API is a system API for operations on the american table in
the training database.
Supported operations
Get all flights
Get a flight with a specific ID
Add a flight
* American Flights API - /{ID} DELETE method
delete:
responses:
200:
body:
application/json:
example:
message: Flight deleted (but not really)
* MODULE 4 **********************************************************
* MySQL database
db:
host: "mudb.mule-training.com"
port: "3306"
user: "mule"
password: "mule"
database: "training"
American table: american
Account table: accounts
Account list URL: http://mu.mule-training.com/accounts/show
or if using mulesoft-training-services.jar application:
http://localhost:9090/accounts/show.html
* MySQL database as URL and driver name
URL: jdbc:mysql://mu.mule-training.com:3306/training?user=mule&password=mule
Driver class name: com.mysql.jdbc.Driver
* Derby database
URL: jdbc:derby://localhost:1527/memory:training
Driver class name: org.apache.derby.jdbc.ClientDriver
* SQL input parameter
{'ID' : attributes.uriParams.ID}
* American Flights API - /flights POST response example
{"message": "Flight added (but not really)"}
* American Flights API - /{ID} PUT method
put:
body:
application/json:
type: AmericanFlight
examples:
input: !include examples/AmericanFlightNoIDExample.raml
responses:
200:
body:
application/json:
example:
message: Flight updated (but not really)
* MODULE 5 **********************************************************
* Your client ID
* Your client secret