diff --git a/FunctionApp/UploadDocumentToLoxo.cs b/FunctionApp/UploadDocumentToLoxo.cs index afd0d80..1bc6856 100644 --- a/FunctionApp/UploadDocumentToLoxo.cs +++ b/FunctionApp/UploadDocumentToLoxo.cs @@ -25,19 +25,21 @@ public async Task Run( HttpRequest req, ILogger log) { - string personId = req.Query["person-id"]; - if (string.IsNullOrEmpty(personId)) - { - return new BadRequestObjectResult("Missing person-id in query parameters."); - } var requestBody = await new StreamReader(req.Body).ReadToEndAsync(); dynamic data = JsonConvert.DeserializeObject(requestBody); string fileUrl = data?.fileUrl; + string personId = data?.data?.personID; + if (string.IsNullOrEmpty(fileUrl)) { return new BadRequestObjectResult("Missing fileUrl in request body."); } + + if (string.IsNullOrEmpty(personId)) + { + return new BadRequestObjectResult("Missing personID in request body."); + } using var httpClient = new HttpClient();