Skip to content

andynewcomb/IntermediaryService

Repository files navigation

Summary: 
Intermediary API Service that takes requests from a user to initiate a transaction on a fictitious third party service.
The transaction can take up to 10 days to complete. 
Users can send a POST to start the transaction.
Users can send a GET to receive status updates.
Try the live application running in Azure by using PostMan (https://www.getpostman.com/) to send requests.

-----Endpoint1 (send a post to the following URL with the following JSON object in the body of the request)
POST https://intermediaryservicefirst.azurewebsites.net/request?code=IIDziKrTjabXroyONqLJkH1/4QD/ccPgcRt2m8Z0ia/7MN3G2TEyaw==
{
"body":"This is a sample document"
}
You should receive back a GUID that represents the created document.


-----Endpoint2 (send a post to the following URL with the string "STARTED" in the body (without quotes)). 
Note: Replace {guid} in the URL with the guid returned from Endpoint1 above.
POST https://intermediaryservicefirst.azurewebsites.net/{guid}/ThirdParty?code=/D3vup4U0eHfyeTL/NcAbKbr6LpGaSPLUICsAhTYZqZcVFTXp7v6Ow==
This simulates the third-party making a request to the API and should return a 204 response.


-----Endpoint3 (send a PUT to the following URL with the below JSON object in the body of the request)
Note: Replace {guid} in the URL with the guid returned from endpoint1 above.
PUT https://intermediaryservicefirst.azurewebsites.net/{guid}/ThirdParty?code=lmmAO2AGjgMARaqTp6e66PPZnlY/sV4rOinSPhnaPaVXGOjfhzaKEQ==
{
"Status":"PROCESSED",
"Detail":"Completed on time"
}
You should receive a 204 response. This simulates the third party application giving status updates.


-----Endpoint4 (send a GET to the following URL to obtain the status of any document
Note: Replace {guid} in the URL with the guid returned from Endpoint1 above.
GET https://intermediaryservicefirst.azurewebsites.net/status/{guid}?code=WvllT7a4N2obxuAVY2RbfbbjUrY5AveUdJYkO9J2ygSNvZtF1Jq3zQ==


Notes/Prerequisites: 
This application is a coding challenge and does not actually access a third party service.
Both the local application and the application running on Azure use the same CosmosDb in Azure.

*Visual Studio 2019 -
Visual studio 2019 or later running on a windows machine with the "Azure Development" workload

*Instructions: 
clone the repository
open IntermediaryService.sln in visual studio 2019
Click the green "run" triangle to start the application.
A console window will appear showing the localhost URLs for the 4 API endpoints.
Use Postman to test the local endpoints using the same instructions when trying the live application on Azure.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages