text.delete

Delete a text from the collection. Returns TRUE if succeded else returns an error code.
Warning: This will remove all results for the text.

Request Parameters

collection_idint (required)
Collection id where text is stored.
text_idint (required)

Id for the text.

Can use ext_text_id if exists instead.
ext_text_idString

External text id to be deleted.

Response Parameters

successboolean
Returns true if the delete was a success else returns and exception.

Code Examples

JSON

//Request
{
  "method":"text.delete",
  "params":{
    "collection_id":607,
    "text_id":3,
    "ext_text_id":"A21"
  },
  "id":0
}
 
//Response
{
 "id":0,
 "result":{
    "success": true
  }
}

Java

// You need to have a ready-to-use client to use the other methods
SaploClient client = new SaploClient("YOUR_API_KEY", "YOUR_SECRET_KEY");

// Create a SaploTextManager to work with texts
SaploTextManager textMgr = new SaploTextManager(client);

// Assuming you know the ID of the text you want to delete
SaploText text = new SaploText();
text.setId(textId);

// Delete the text from the API
textMgr.delete(text);

PHP


$client = new SaploAPI("YOUR API KEY", "YOUR SECRET KEY");
  
$params = array(
    'collection_id' => 606,
    'text_id' => 11
);

try {
    $result = $client->text->delete($params);
} catch(SaploException $e) {
    echo '(' . $e->getCode() . ') ' . $e->getMessage();
}
  
var_dump($result);

Python


client = SaploJSONClient("YOUR API KEY", "YOUR SECRET KEY")

deleted_text = client.text.delete(
            collection_id=678,
            text_id=2
            )

print "Successfully deleted text."

Matlab

params.collection_id = 2131;
params.text_id = 1;

response = saploRequest('text.delete', params)