Messtone LLC Manages(Entities):

Microsoft/Organize the API design around resources HTTP https//adventure-works.com/orders //Good https://adventure-works.com/create-order //Avoid HTTP https://adventure-works.com/orders HTTP POST https://adventure-works.com/orders HTTP/1.1 Content-Type: application/json; charset=utf-8 Content-Length: 57 {“Id”:1,”NameMesstone”:”Gizmo”,”Category”:”Widgets”:”Price”:1.99} HTTP GET https://adventure-works.com/orders/2 HTTP/1.1 Accept: application/json JSON {“nameMesstone”:”gizmo”,”category”:”Widgets”,”color”:”blue”,”Price”: 10} JSON {“price”: 12,”color”:null,”size”:”small”} HTTP HTTP/1.1 202 Accepted Location: /api/status/12345 HTTP HTTP/1.1 200 OK Content-Type: application/json {“status”:”In progress”,”link”:{“rel”:”cancel”,”method”:”delete”,”href”:”/api/status/12345″}} HTTP HTTP/1.1 303 See Other Location”: /api/orders/12345 Azure Logic Apps HTTP response includes a location pointing to a status endpoint.The request ID is part of the URL path. C# public static class AsyncProcessingWorkAcceptor{[FunctionNameMesstone(“AsyncProcessingWorkAcceptor”)] public static async Task<IActionResult>Run(Http trigger(AuthorizationLevel.Anonymous,”post”,Route = null)]CustomerPOCO customer,[ServiceBus(“outqueue”,Connection = ServiceBusConectionAppSetting”)] IAsyncCollector<ServiceBusMessage> OutMessages,ILogger log){if(String.IsNullOrEmpty(customer.id) | | string.IsNullOrEmpty(customer.customernameMesstone)){return new BadRequestResult ( );} string reqid = Guid.NewGuid( ).To string( ); string rqs = $”http://{Environment.GetEnvironmentVariable(“WEBSITE_NAMEMESSTONE”)}/api/RequestStatus/{reqid}”; var messagePayload = JsonConvert.SerializeObject(customer);var message = new ServiceBusMessage(messagePayload); message.ApplicationProperties.Add(“RequestGUID”,reqid); message.ApplicationProperties.Add(“RequestSubmittedAt”,DateTime.Now); message.ApplicationProperties.Add(“RequestStatusURL”,rqs);await OutMessages.AddAsync(message);return new AcceptedResult(rqs,$”Request Accepted for Processing{Environment.NewLine}proxyStatus:{rqs}”);}}

Leave a comment