Delete document from document service (SCP) - cmis

I've used this tutorial to create a document service API and the documents are uploading just fine. I'm trying to delete a document now, but there doesn't seem to be much information on that subject.
Can I delete a document with a Delete request and the document ID or what is the best practice?

Yes, you should delete request by passing the document id.
If you are using java CMIS client library, then Session#delete methods should be used.
Best Regards,
Saurav

Related

Clear complete Table for custom entity via App?

Is it possible to clear the complete table via an App through the API for a custom entity?
I tried a DELETE but get an error message: Method Not Allowed (Allow: GET, POST)
The documentation states, that its not needed to set the permission in the xml for the own entity. And I can see that also the delete permission is set when looking at the permissions from the App.
How can I achieve this?
Thanks,
Danny
You can use the sync endpoint to mass-delete records but you will still need the ids for all the records to be deleted. There is no way to truncate a table via the api if that is what you're looking for.

How to change de document folder?

I have tried to change the folder where the document are stored in the E-signature API.
But when i do that the API cannot find those documents.
There is a special way to do that ?
Thank you for you responses.
The way to move envelope is to use this API endpoint. You should be able to see the envelope in the new folder. To list folder envelopes you can use
GET /restapi/v2.1/accounts/{accountId}/folders/folder_id?include_items=true
What do you see if you get envelope folder information with
GET /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}?include=folders

How to Delete attachment in Asana trough API

I have started implementing Asana APIs in my project where I create tasks in a particular project through API and then I add attachments to particular ask using through API,
However, I struggle in the case where I need to replace the attachment with a new one, the asana documentation for attachment does not provide a description for any API that can delete/replace an attachment directly neither the edit task API has this option
So How do I replace(or at least delete so that I can upload a new one), What is the best alternative way?
To delete an attachment, you can use the method DELETE with the same url as "Get an attachment". For modifying it, maybe it is possible to do it with PUT or PATCH, but I didn't test it.
I got the answer from Asana Community forum by Frederic_Malenfant stating that
It looks like the “new documentation” is missing that information!
But, the old one has, and you should send a “DELETE” to the attachment
ID, like: DELETE /api/1.1/attachments/123456789 You don’t need to
specify the task, just the document ID.
and I tried the DELETE API and it works
DELETE https://app.asana.com/api/1.1/attachments/:attachment_id
Somehow, the updated documentation is the missing description for the Delete attachment API despite the existence of the API.
Nevertheless,
The response for this delete API is quite weird, it replies empty object with key "data" in response as below
{
"data": {}
}

Purging documents in Couchbase Lite

I have a mobile app using Couchbase lite. When the user logouts, I want to remove some of the documents on the device; the user-specific documents. I do not want to remove all of the documents. Documents have a purgeDocument() method that I thought I could call on those user-specific documents.
The problem is that the purged documents are not re-synced down to the device if the user logs back in and a pull replication is run.
Based on the little I know of CouchDB sync protocol, it makes sense that those are not re-synced down because there are not newer Sequence updates on those user-specific documents to trigger a re-sync.
How should I approach this problem?
Possibilities
Delete the whole database (including common documents) and lose performance.
Somehow reset the last sequence for the replicator and hope the replicator does not transfer the already-downloaded docs over the wire. (Probably would screw up CBL)
Have separate databases, one that stores the user-specific docs and one that contains common docs. Databases can have filtered replicators (by channel) so it would be feasible to partition the incoming data into separate databases. The problem would be the seamless reference loading between documents of differing databases when using CBLModel objects wrappers.
As i understand from the official documentation in the subsection Purging documents, you are not retrieving the document again just because it has not been modified/updated (in short, its rev is the same) on the server side.
You can try to create again a dummy document with the same type and, for example, username (or whatever you are using to identify the user's configuration) when the user logs again in your app so that you trigger the pull replication from the server. You probably will have a conflict that can easily be solved taking the revision from the server.
I hope this idea helps a little.
UPDATE AFTER COMMENT
The idea is to store somewhere the id and type of the user's documents you're going to purge. That way you can create a new dummy document with those two fields when the user logs in again. Perhaps this new dummy document triggers the pull replication.
NOTE: I haven't tried this method. I am just guessing what it might be a work around to your problem.
I would suggest that your backend modifies the selected documents - this could be just a timestamp update - upon user login, which will post the new revisions to the device
You can keep purging the documents when the user logs in.
To solve problem of re-syncing specific document, I think the easiest way is to use filtered replication where the filter is document id.
These document IDs can be created in a manner which can be derived. For example it can be as UserDocument::.
Now when the user logs in you can start one shot replication with document ID as filter. This can only be done in one shot. And when this One Shot finishes you can start replication again by changing the setting of the replication(changing filter/channel).
following is the URL by Couchbase which explains filtered replication by document ID.
https://developer.couchbase.com/documentation/mobile/1.4/guides/couchbase-lite/native-api/replication/index.html#filtering-by-document-ids
Try Push after Purging the document with Couchbase Lite which allows you to Pull the document from the server at a later point.

docusignapi Add document binary

I'm trying to add a document to envelope. However I have that document in a blob column in the Oracle database. I tried to load that in the blob variable, convert to clob (using blob2clob oracle function) and send the information. however, I always get the document empty on docusign. So, I was thinking a way to send the information in binary form.
Does somebode know the correct setup to sent taht or any help with this?
Thank you,
Jose
Give this thread on the DocuSign community a look and see if it will resolve your issue

Resources