Creating a new letter using SWAGGER

We can also create a new application for a letter of credit from the SWAGGER view. Select the InitialApplication API.

We're going to use the POST verb to create yet another application for Alice:

In the value box, paste the following data:

{
"$class": "org.example.loc.InitialApplication",
"letterId": "LPLAYGROUND2",
"applicant": "resource:org.example.loc.Customer#alice",
"beneficiary": "resource:org.example.loc.Customer#bob",
"rules": [
{
"$class": "org.example.loc.Rule",
"ruleId": "rule1",
"ruleText": "This is a test rule."
}
],
"productDetails": {
"$class": "org.example.loc.ProductDetails",
"productType": "Mouse Mat",
"quantity": 40000,
"pricePerUnit": 5
}
}

Can you see what this application is for? Can you see how Alice wants to apply for a letter to buy 40000 Mouse mats from Bob at 5 dollars each?

If you press Try it out!, a new letter will be created! You can now view this new letter using the SWAGGER console, the application, or the Playground. Let's try each:

This is the view using SWAGGER:

This is the view using the Playground:

This is the view using the application (Matias's view):

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.191.86