Skip to main content

 Web service API

How to use PageSeeder's Web service API

get task

/members/{member}/tasks/{taskid} [GET]

com.pageseeder.comment.GetDiscussion

Description

Load a single task from accessible groups.

The @status, @priority, @due attributes and <assignedto> element might not be included if comments=first or none and the last comment in the task is not loaded.

Parameters

NameDescriptionRequiredTypeDefault value
commentsThe comments to include, can be none, first, last, all, archivenostringall
returngroupsThe groups to return in the output, can be none, user, all (administrator only  includes all comments)nostringnone
tasksizeThe maximum number of comments to return per tasknostring1000
draftIf true include draft comment for current member (might return tasksize + 1)nobooleanfalse

Permission

Only the member or an administrator can invoke this service and the member must have access to the task.

Response

When the task is valid, the output has the following format:

<task id="330" 
      title="Make test the document 1" 
      replycount="0" 
      lastcommentid="335" 
      lastcommentdate="2017-02-23T11:10:42+11:00" 
      status="Open"
      priority="Medium"
      due="2017-02-23T17:00:00+11:00">
  <group id="8" 
         name="pub-a" 
         description="A sample public group" 
         owner="pub" 
         access="public"
         common="false"/>
  <assignedto id="1" 
              firstname="firstName"
              surname="surName" 
              username="userName" 
              status="activated" 
              date="2017-02-23T11:10:42+11:00">
    <fullname>A Complete Name</fullname>
  </assignedto>
  <comment id="330" 
           contentrole="Comment" 
           contentrole="File Attachment"
           created="2017-02-23T11:10:42+11:00"
           status="Open" 
           priority="Medium"
           due="2017-02-23T17:00:00+11:00">
    <title>Make test the document 1</title>
    <author id="1" 
            firstname="firstName" 
            surname="surName" 
            username="userName" 
            status="activated">
      <fullname>A Complete Name</fullname>
    </author>
    <assignedto id="1" 
                firstname="firstName" 
                surname="Akaishi" 
                username="userName"
                status="activated"
                date="2017-02-23T11:10:42+11:00">
      <fullname>A Complete Name</fullname>
    </assignedto>
    <content type="text/plain">Make test the document 1</content>
    <attachment>
      <uri id="91" 
           scheme="http" 
           host="localhost" 
           port="80" 
           path="/ps/pub/a/attachments/2017/02/lista_field-1.odt"
         decodedpath="/ps/pub/a/attachments/2017/02/lista_field-1.odt"
           external="false" 
           mediatype="application/vnd.oasis.opendocument.text"
           created="2017-02-23T15:07:53+11:00" 
           modified="2017-02-23T15:07:53+11:00"
           size="13730">
        <displaytitle>lista_field-1.odt</displaytitle>
      </uri>
    </attachment>
  </comment>
  <comment id="334"> ... </comment>
  <comment id="335"> ... </comment>
  <content type="text/plain">Exemplo Task 2</content>
</task>

Otherwise returns an error:

<error id="1316">
  <request>/ps/service/members/surname/tasks/344</request>
  <message>No discussion or reply found with ID 344</message>
</error>

By default, all discussions and comments are included.

Effect of comments parameter

If comments is first:

<task id="330" title="Task 2">
  <group id="8" ... common="false"/>
  <comment id="330"> ... </comment>
</task>

If comments is last:

<task id="330" title="Task 2">
  <group id="8" ... common="false"/>
  <comment id="335"> ... </comment>
</task>

If comments is archive:

<task id="330" title="Task 2">
  <group id="8" ... common="false"/>
  <comment id="330"> ... </comment>
  <comment id="334"> ... </comment>
  <comment id="335"> ... </comment>
  <comment id="336"
           contentrole="archive-File Attachment" 
           created="2017-02-23T15:07:53+11:00" 
           status="Open"
           priority="High" 
           due="2017-02-23T17:00:00+11:00">
    <title>Task 2</title>
    <author id="1" ... > ... </author>
    <modifiedby id="1" ... > ... </modifiedby>
    <assignedto id="1"> ... </assignedto>
    <content type="text/plain">Exemplo Task 2</content>
  </comment>
</task>

Error Handling

CodeCause / Description
0x1325The task or reply was not found
0x0106Unable to find matching member
Created on , last edited on