I am trying to start a search task and then retrieve the results using the Laserfiche API.
This is my POST request which starts the asynchronous search task:
And this succeeds and returns a taskId:
202 ... { "@odata.context": "https://api.laserfiche.ca/repository/v2/$metadata#Laserfiche.Repository.StartTaskResponse", "taskId": "82a5dbf1-073d-4fd8-8c6a-61a9fe513832" }
EDIT: It returns a 202 response but it also returns a location URL (ex: https://api.laserfiche.ca/repository/v2/Repositories/r-0001/Tasks?taskIds=9e18b8b2-5486-41dc-99e7-69bf34f524f6) and in this URL it actually says:
{"type":"accessDenied","title":"Error: Invalid or expired access token.","status":401,"instance":"/repository/v2/Repositories/r-0001/Tasks","operationId":"478c3c68079b435fa28749a2e344df72","errorSource":"Api Server","errorCode":201,"traceId":"00-e4013d8c132147dd521435a9cb3d43e4-66466f83a9298503-00"}
So it's actually failing but in the Web Request response page it shows 202.
When I then try to get the results for the task with id taskId though using a GET request:
404 ... { "type": "https://httpstatuses.io/404", "title": "Not Found", "status": 404, "traceId": "00-d86d6c7d786223c1b70ebc82f4fdcbb0-f04ed7295c1f8965-00" }
A 404 response means "Request taskId not found." and I am not sure why there is no trace of it. I tried to wait for a minute before running the GET task and it still gets the 404 error. I also tried running it directly in a workflow and the taskId is never found. Any ideas of why this could be?