PHP Trash Document Via API

  • 1
  • Question
  • Updated 2 months ago
Hi - 

Got some of the other API calls working, but having some issues with trashing documents:

Current call used w/ path:

  function trashDocument($guid) {
    $url = "/api/documents/$guid/trash.xml";

    return $this->signAndSendRequest("POST", $url);
  }

Current Response:

SimpleXMLElement Object ( [body] => You are being . )



any ideas?
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes

Posted 4 months ago

  • 1
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
This is for the Right Signature API, sorry for leaving that out
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
let me know if anyone knows if this is still active
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
thread bump
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
thread bump
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
Thread bump
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
THread bump
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
Thread Bump
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
Thread Bump
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
Thread Bump
Photo of Saravanan Kannan

Saravanan Kannan, Software Engineer

  • 84 Posts
  • 12 Reply Likes
Hi Justin,

The api call seems right to me. Can you try this 
curl -X POST -H "api-token:YOUR_SECURE_API_TOKEN" https://rightsignature.com/api/documents/YOUR_DOCUMENT_GUID/trash.xml and check whether you are able to trash the document through curl. Then we could debug why this is not happening in your code.

Thanks
Saravanan
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
looks like I am getting a 404 you are being redirected error

test doc: NU9YKDJHBLZRLYHNLFSZHX

endpoint: https://rightsignature.com/api/documents/NU9YKDJHBLZRLYHNLFSZHX/trash.xml 
Photo of Justin Fahrenbach

Justin Fahrenbach

  • 15 Posts
  • 0 Reply Likes
any luck on your end on this?
Photo of Saravanan Kannan

Saravanan Kannan, Software Engineer

  • 84 Posts
  • 12 Reply Likes
I tried this on test document 
curl -X POST -H "api-token:private_token" https://rightsignature.com/api/documents/doc_guid/trash.xml

and it successfully trashed the document.

If you are the owner of the document and if it is not signed, you should be able to trash that document. I looked at the document and it is expired, but it should not affect this end point, it should still work. Can you trigger another api call for this same document?

Thanks
Saravanan