1

I have a single end point of a web service where you can queue items for processing by a bot. The items are queued, so it can take quite a while before they are actually processed.

If someone make a request, one of the following three options can occur:

  1. The item is not yet in queue and will be queued. The end point will return 202 Accepted.
  2. The items has already been queued, but not yet processed. This is what I need a status code for.
  3. The item has been processed and data is available. Either 200 OK + data or 404 Not found will be returned.

I have looked in RFC7231 for ideas, but I don't really see anything for item's already in queue (step 2).

By name alone, the one called 208 Already reported sounds good. But it appears to be specific to WebDAV, so that doesn't sound like a good idea to use.

Obviously 409 Conflict sounds like a good option, but that would require another end point to handle returning the answer, once the item is processed. I might have trouble getting the people who designed the process to accept this.

What status code tells the client that their request is already being processed?

2
  • 1
    "The representation sent with this response ought to describe the request's current status and point to (or embed) a status monitor that can provide the user with an estimate of when the request will be fulfilled." Returning 202 Accepted with a Location that the client can poll for information is one way to do this, separate the "start process" endpoint from the "updates or outcome" endpoint. Commented Mar 15, 2021 at 9:33
  • @jonrsharpe that was also my initial argument, but I failed to convince the others working on the project. If it is the only reasonable solution, I will try again. I just wanted to seek out all options first. Commented Mar 15, 2021 at 9:35

1 Answer 1

0

"HTTP Status 202 indicates that the request has been accepted for processing, but the processing has not been completed"

source

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.