0% found this document useful (0 votes)
4 views1 page

Explore REST Protocol with Swagger

This document outlines an exercise for exploring the REST Protocol using Swagger, specifically in the context of a coffee shop application. Participants will learn to generate a Service Access Key, use it to add a new coffee, and verify its addition through GET requests. The exercise emphasizes the importance of unique keys for customer-specific coffee management.

Uploaded by

nfabianar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Explore REST Protocol with Swagger

This document outlines an exercise for exploring the REST Protocol using Swagger, specifically in the context of a coffee shop application. Participants will learn to generate a Service Access Key, use it to add a new coffee, and verify its addition through GET requests. The exercise emphasizes the importance of unique keys for customer-specific coffee management.

Uploaded by

nfabianar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Rest Exercises

REST EXERCISES
Exercise 01 | Exploring the REST Protocol
Objective
By the end of this exercise, you will be able to explore the REST Protocol using Swagger by simulating the web process, which
usually takes place when a task is executed between a client and a server.

Why is this important?


To gain a full understanding of the REST Protocol.

Busness context:
A coffee company has multiple shops. In each shop, a customer can create and delete their own coffee, without being able
to see, alter or delete other customer’s coffees. The default coffees of the shop can be seen, but not altered or deleted. To
achieve this, each customer will need to have a unique key.

Instructions

1. Open the Coffeeshop at [Link]

2. Generate the Service Access Key and keep a note of it. Each key is valid for 24 hours.
3. Enter the Service User Interface on Swagger by visiting the following address:
[Link]
Test the POST function in Swagger:
• Click on Coffees -> POST.
• Paste the key into the key text field.
• Enter a new coffee according to the example value, replacing two “string” values. For example:
4. {
"Name": "Batcoffee",
"Description": "Full of justice."
}
• Click “Try it out!”
Verify whether the coffee has been added by trying out the GET function:
• Click on GET/api/Coffees/{key}
5. • Enter the key obtained in Step 2
• Click “Try it out!”
• Verify if the new coffee is in the Response Body

Hints
» If you get an error with the message "ExceptionMessage": "Key '{key}' not recognized - Please generate a new key!",
check if the key you entered is correct and whether you have accidentally pasted an empty character along with the
key. This applies to Swagger, the API Scan and Tosca Commander.

You might also like