409 resource conflict error when replacing the contents of a document

I'm trying to use the PostContentmanagementDocumentContent call to replace the contents of a document in a workspace, and I'm always getting a 409 error back with "Resource conflict". Why might this be happening?

The value provided for changeNumber is probably incorrect. If you can provide the correlation ID from the response, I can see if there's any additional traces to clarify.

On that note, should the changeNumber reflect an incremental number, or should it reflect the current changeNumber? I've tried both and it doesn't seem to make a difference.

I think it's supposed to be the same so you're telling the server you intend to update that version. Can you provide the correlation ID from the response header?

The exception data doesn't seem to provide a correlationId, but there is a contextId. Here's an example of the error message (Note that this command was executed in the staging environment):

{"status":409,"code":"conflict","message":"Resource conflict update document: d8597740-fc2f-4582-82e4-747b686036b8","contextId":"9757830e-65ff-4ab4-a7a2-c28751358bf2","details":[],"errors":[]}

Okay, I do have it set to the same changeNumber value as the current version.

The correlation ID and context ID are the same thing. The correlation ID is found in the response headers: https://developer.mypurecloud.com/api/rest/tips/index.html#8. I'll take a look.

Here's the source error for that correlation ID: Change number resource conflict updating document: d8597740-fc2f-4582-82e4-747b686036b8: requested: 0, current: 2

Hmmm... it may be that the logic I'm using to keep track of the changeNumber is incorrect. Thanks for that tip, I'll look into it.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.