Status: Open
Status: Answered
Status: Closed
Status: Duplicate

Deleting a Document via REST

0
Posted Aug 22 by Eben de Roock.
Updated Aug 22 by Marcin Pacyga.

Hi,

I'm trying to delete a document using the REST API for Content Server, but I get an Authentication Required error, but if I change my request method to GET from DELETE I do not get the error and the node details are returned.

Any ideas what can be wrong?

Thanks, Eben

14 Answers

0
BEST ANSWER: As chosen by the author.

That is unusual. The OTCSTicket is being included in the header of both REST API calls I'm assuming. What do the user's permissions on the object look like?


0
BEST ANSWER: As chosen by the author.

> That is unusual. The OTCSTicket is being included in the header of both REST API calls I'm assuming. What do the user's permissions on the object look like?

Yes, I'm using the exact same request, just changing the method to DELETE. I'm currently using a system administrator to do the delete so permissions should not be an issue


0
BEST ANSWER: As chosen by the author.

What version of Content Server and the REST API are you using?


0
BEST ANSWER: As chosen by the author.

> What version of Content Server and the REST API are you using?

We are using Content Server 10 Update 2014_06 with REST API version 10.0.0


0
BEST ANSWER: As chosen by the author.

What are you using to do this test? Can you reproduce the behaviour with a REST API client in chrome or in firefox and the same data?


0
BEST ANSWER: As chosen by the author.

Hi Eben, just to be clear… you have authenticated into the REST API via:

POST /auth
username=<your admin username>
password=<your admin password>

And it returned an OTCSTICKET to you (a string of a jumble of letters/numbers/symbols). Using this OTCSTICKET, you set it as a header for the next call:

DELETE /nodes/1234 (where 1234 is the id of your document)

And it failed on authentication?


0
BEST ANSWER: As chosen by the author.

This forum thread I wrote might be helpful:

Content Server API with Postman REST Client


0
BEST ANSWER: As chosen by the author.

@Matthew Pinkney
I tried this within my web app and from Chrome's Postman REST Client, I had the same issue on both

@Kevin Mark
I'm doing my authentication a bit differently, I'm getting my OTCSTicket directly from Content Server and passing to through to the page, I can upload the document with the OTCSTicket, but I cannot delete it. With the Postman REST Client I do the POST/auth request first and use that OTCSTicket to do the delete request, but it fails as well

@Andre Kusuma
I've tried Postman as well, I get the same issue.

Currently what my goal is for this web app is that when a user submits his request the files are first uploaded to Content Server, once done we get the Data Ids from the response and submit them to be stored on the database along with the form data, if this form fails to submit we need to delete the documents from Content Server as they are confidential. If the form succeeds the files are then moved by the admin user to a secure location.

Can the problem be that I'm trying to delete a newly created document? I might have to try deleting an existing document when I get back to the office


0
BEST ANSWER: As chosen by the author.

Are you using IIS? If so, could you check something in your IIS? Under Default Web Site, locate the mapping to your <OTHOME>/cgi directory and look in 'Modules' and 'Handler Mappings'. Do you see anything called 'WebDAV' in there?


0
BEST ANSWER: As chosen by the author.

@Eben de Roock
Let me know how you go with deleting existing document, I did deleted newly created document with no issue. Do you have OTDS in the picture?


0
BEST ANSWER: As chosen by the author.

@Kevin Mark
I have checked under IIS and the webdav is there.

@Andre Kusuma,
We use the Open Text Directory Services Integration module for AD authentication

I have tried to delete the document via Chrome's POSTMan and Advanced REST Client, but both fail.

The message we are getting:

> 403 Forbidden: Access is denied.
>
> You do not have permission to view this directory or page using the
> credentials that you supplied.


0
BEST ANSWER: As chosen by the author.

We had some issues with DELETE and PUT not working because of webdav. First, could you try to run a PUT operation such as PUT /nodes/12345 (where 12345 is the id of your document), with name as a form parameter containing a new name for the document?

If this fails to work, then it is most likely webdav that's interfering (WebDAV interferes with both DELETE and PUT operations). In that case, you could try removing WebDAV from 'Modules' and 'Handler Mappings' in your IIS (I would do this after backing up whatever is necessary to restore your system to default). Or you could install a separate instance of Content Server in order to test this out.


0
BEST ANSWER: As chosen by the author.

@Eben, I have OTDS in the mix as well, but I did not have any issues, but I do not have WebDav in my case. Kevin could be on the money here.


0
BEST ANSWER: As chosen by the author.

Symptoms of the WebDAV misconfiguration are missing CORS headers in the REST API response; Access-Control-Allow-Origin, for example. You can inspect the response in Fiddler, for example.


 You have subscribed and will receive email notifications of updates to this topic. To unsubscribe, uncheck the checkbox.

Statistics

Related categories

Related tags

Your answer

To leave an answer, please sign in.