group.listTexts

Get a list of all texts that exists in a group.

Request Parameters

group_idint (required)
The group id.

Response Parameters

collection_idint
Collection id for a text.
text_idint
Id for a text.
ext_text_idString

The external id if there is any.

Code Examples

JSON

//Request
{
  "method":"group.listTexts", 
  "params":{
    "group_id":744
  }, 
  "id":0
}

//Response
{ 
 "id":0,
 "result":{
    "texts":[
        {
          "collection_id":607,
          "text_id":6310,
          "ext_text_id": "AX-4141-DD-0F"
        }
    ]
}

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 SaploGroupManager to work with groups
SaploGroupManager groupMgr = new SaploGroupManager(client);

// Assuming you know the ID of the group you want to list Texts for
SaploGroup group = new SaploGroup();
group.setId(groupId);

// Get a list of all texts in the group
List<SaploText> textList = groupMgr.listTexts(group);

// Print them out
for(SaploText text : textList)
    System.out.println(text.getHeadline());

PHP

$client = new SaploAPI("YOUR API KEY", "YOUR SECRET KEY");

$params = array(
    "group_id" => 21
);
 
try {
    $result = $client->group->list_texts($params);
} catch(SaploException $e) {
    echo '(' . $e->getCode() . ') ' . $e->getMessage();
}
   
var_dump($result);

Python


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

text_list = client.group.list_texts(
            group_id=787
            )

print "Listing all texts in group:", text_list

Matlab

params.group_id = 415;

response = saploRequest('group.listTexts', params)