Hi Sana,
Here is the 'Exact' issue:
a. I try to do a GET request with this API endpoint URL : https://p8blkchwkbench-bk3m3c-api.azurewebsites.net/api/v2/contracts
I get a 404 - Resource Not found error
b. I try to do a GET request with this API endpoint URL : https://p8blkchwkbench-bk3m3c-api.azurewebsites.net/api/v2/contracts/344
I get a 200 with proper response from JSON.
c. Documentation for the API calls is here: https://p8blkchwkbench-bk3m3c-api.azurewebsites.net/
d. The console logs of my web app service for both the successful one and the unsuccessful one are given below:
2020-06-23T08:52:40.494160092Z [08:52:40 INF] {Protocol="HTTP/1.1", Method="GET", ContentType=null, ContentLength=null, Scheme="http", Host="p8blkchwkbench-bk3m3c-api.azurewebsites.net", PathBase="", Path="/api/v2/contracts/344", QueryString="", EventId={Id=1}, SourceContext="Microsoft.AspNetCore.Hosting.Internal.WebHost", RequestId="0HM0HSS2FG6SF:00000001", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Request starting HTTP/1.1 GET http://p8blkchwkbench-bk3m3c-api.azurewebsites.net/api/v2/contracts/344
2020-06-23T08:52:40.496391406Z [08:52:40 INF] {EventId={Id=2}, SourceContext="Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler", RequestId="0HM0HSS2FG6SF:00000001", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Successfully validated the token.
2020-06-23T08:52:40.499864329Z [08:52:40 INF] {EventId={Id=8}, SourceContext="Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler", RequestId="0HM0HSS2FG6SF:00000001", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} AuthenticationScheme: Bearer was successfully authenticated.
2020-06-23T08:52:40.500649533Z [08:52:40 INF] {SourceContext="data-access", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Execute [dbo].[GetUserByExternalId] with externalId = 3d5a609c-0de8-4cb7-a64f-b28580c9977d
2020-06-23T08:52:40.501213937Z [08:52:40 INF] {SourceContext="data-access", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Executing sproc [dbo].[GetUserByExternalId]
2020-06-23T08:52:40.512952711Z [08:52:40 INF] {SourceContext="data-access", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Execute [dbo].[GetUserChainMappings] with id = 4
2020-06-23T08:52:40.513741616Z [08:52:40 INF] {SourceContext="data-access", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Executing sproc [dbo].[GetUserChainMappings]
2020-06-23T08:52:40.519059650Z [08:52:40 INF] {EventId={Id=1}, SourceContext="Microsoft.AspNetCore.Authorization.DefaultAuthorizationService", ActionId="b16abfb7-4fe8-43a6-95ab-a1a313df5b2a", ActionName="Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractGet (Microsoft.AppBuilder.API)", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Authorization was successful for user: XXXXXXXXXXXXXXXX.
2020-06-23T08:52:40.520115957Z [08:52:40 INF] {EventId={Id=1}, SourceContext="Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker", ActionId="b16abfb7-4fe8-43a6-95ab-a1a313df5b2a", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Executing action method Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractGet (Microsoft.AppBuilder.API) with arguments (["344"]) - ModelState is Valid
2020-06-23T08:52:40.520736161Z [08:52:40 INF] {SourceContext="data-access", ActionId="b16abfb7-4fe8-43a6-95ab-a1a313df5b2a", ActionName="Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractGet (Microsoft.AppBuilder.API)", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Execute [dbo].[GetContract] with contractId = 344, userId = 4, isAdmin = True
2020-06-23T08:52:40.521628566Z [08:52:40 INF] {SourceContext="data-access", ActionId="b16abfb7-4fe8-43a6-95ab-a1a313df5b2a", ActionName="Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractGet (Microsoft.AppBuilder.API)", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Executing sproc [dbo].[GetContract]
2020-06-23T08:52:40.536901463Z [08:52:40 INF] {EventId={Id=1}, SourceContext="Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor", ActionId="b16abfb7-4fe8-43a6-95ab-a1a313df5b2a", ActionName="Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractGet (Microsoft.AppBuilder.API)", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext.
2020-06-23T08:52:40.539096077Z [08:52:40 INF] {EventId={Id=2}, SourceContext="Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker", ActionId="b16abfb7-4fe8-43a6-95ab-a1a313df5b2a", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Executed action Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractGet (Microsoft.AppBuilder.API) in 20.1865ms
2020-06-23T08:52:40.541259891Z [08:52:40 INF] {ElapsedMilliseconds=47.6312, StatusCode=200, ContentType="application/json; charset=utf-8", EventId={Id=2}, SourceContext="Microsoft.AspNetCore.Hosting.Internal.WebHost", RequestId="c938a005-4678-4d53-a384-7bb998d07b36", RequestPath="/api/v2/contracts/344", ServiceName="appbuilder.api"} Request finished in 47.6312ms 200 application/json; charset=utf-8
2020-06-23T08:52:52.299079157Z [08:52:52 INF] {Protocol="HTTP/1.1", Method="GET", ContentType=null, ContentLength=null, Scheme="http", Host="p8blkchwkbench-bk3m3c-api.azurewebsites.net", PathBase="", Path="/api/v2/contracts", QueryString="", EventId={Id=1}, SourceContext="Microsoft.AspNetCore.Hosting.Internal.WebHost", RequestId="0HM0HSS2FG6SG:00000001", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Request starting HTTP/1.1 GET http://p8blkchwkbench-bk3m3c-api.azurewebsites.net/api/v2/contracts
2020-06-23T08:52:52.301575073Z [08:52:52 INF] {EventId={Id=2}, SourceContext="Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler", RequestId="0HM0HSS2FG6SG:00000001", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Successfully validated the token.
2020-06-23T08:52:52.301833875Z [08:52:52 INF] {EventId={Id=8}, SourceContext="Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler", RequestId="0HM0HSS2FG6SG:00000001", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} AuthenticationScheme: Bearer was successfully authenticated.
2020-06-23T08:52:52.302101876Z [08:52:52 INF] {SourceContext="data-access", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Execute [dbo].[GetUserByExternalId] with externalId = 3d5a609c-0de8-4cb7-a64f-b28580c9977d
2020-06-23T08:52:52.303731187Z [08:52:52 INF] {SourceContext="data-access", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Executing sproc [dbo].[GetUserByExternalId]
2020-06-23T08:52:52.308975720Z [08:52:52 INF] {SourceContext="data-access", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Execute [dbo].[GetUserChainMappings] with id = 4
2020-06-23T08:52:52.309884526Z [08:52:52 INF] {SourceContext="data-access", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Executing sproc [dbo].[GetUserChainMappings]
2020-06-23T08:52:52.314373354Z [08:52:52 INF] {EventId={Id=1}, SourceContext="Microsoft.AspNetCore.Authorization.DefaultAuthorizationService", ActionId="7e74b811-c8b1-41b5-a666-7538ff0e7a7c", ActionName="Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractsGet (Microsoft.AppBuilder.API)", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Authorization was successful for user: XXXXXXXXXXXXXXXXXX.
2020-06-23T08:52:52.315218860Z [08:52:52 INF] {EventId={Id=1}, SourceContext="Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker", ActionId="7e74b811-c8b1-41b5-a666-7538ff0e7a7c", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Executing action method Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractsGet (Microsoft.AppBuilder.API) with arguments (["", "", "0", ""]) - ModelState is Valid
2020-06-23T08:52:52.316045665Z [08:52:52 INF] {SourceContext="data-access", ActionId="7e74b811-c8b1-41b5-a666-7538ff0e7a7c", ActionName="Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractsGet (Microsoft.AppBuilder.API)", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Execute [dbo].[GetContracts] with top = null, skip = null, workflowId = 0, userId = 4, isAdmin = True, sortBy = null
2020-06-23T08:52:52.316689469Z [08:52:52 INF] {SourceContext="data-access", ActionId="7e74b811-c8b1-41b5-a666-7538ff0e7a7c", ActionName="Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractsGet (Microsoft.AppBuilder.API)", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Executing sproc [dbo].[GetContracts]
2020-06-23T08:52:52.323091310Z [08:52:52 INF] {SourceContext="data-access", ActionId="7e74b811-c8b1-41b5-a666-7538ff0e7a7c", ActionName="Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractsGet (Microsoft.AppBuilder.API)", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Encountered entity not found in operation [dbo].[GetContracts], Workflow Id 0 not found.
2020-06-23T08:52:52.324734620Z [08:52:52 INF] {EventId={Id=2}, SourceContext="Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker", ActionId="7e74b811-c8b1-41b5-a666-7538ff0e7a7c", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Executed action Microsoft.AppBuilder.API.Controllers.ContractsV2Controller.ContractsGet (Microsoft.AppBuilder.API) in 10.4769ms
2020-06-23T08:52:52.326394831Z [08:52:52 INF] {ElapsedMilliseconds=27.4234, StatusCode=404, ContentType="application/json", EventId={Id=2}, SourceContext="Microsoft.AspNetCore.Hosting.Internal.WebHost", RequestId="b4181e50-f16e-4623-a484-e45146275e95", RequestPath="/api/v2/contracts", ServiceName="appbuilder.api"} Request finished in 27.4234ms 404 application/json