Web service API

How to use PageSeeder's Web service API

 

Output

This document provides some basic explanation about the production of output in a service or servlet response.

XML

PageSeeder services and servlets will all return XML by default. The documentation for the specific service or servlet will list the objects returned but for a detailed description of these objects see the Element reference.

For example the URL /service/groups/acme-specs/members will return:

<memberships count="1">
  <group id="178" name="acme-specs" description="ACME project specifications"
     owner="acme" access="member" common="false"/>
  <membership id="397" email-listed="true" notification="none"
     status="normal" role="manager" created="2015-08-20T11:59:36+10:00">
    <member id="1" firstname="John" surname="Joans" username="jjones"
        email="jjones@allette.com.au" status="activated">
      <fullname>John Joans</fullname>
    </member>
  </membership>
</memberships>

The details of the membership object are shown in the element reference.

JSON

If a service or servlet has JSON listed as one of the outputs at the top of it's documentation then adding .json to the end of it's URL or the HTTP header Accept:application/json will return JSON format. This returns exactly the same information as the XML but in a different format.

For example the URL /service/groups/acme-specs/members.json will return:

{
  "count":1,
  "group":
    {"id":178,"name":"acme-specs","type":"group","description":"ACME project specifications",
     "owner":"acme","access":"member","common":false
    },
   "memberships":[
     {"id":397,"email-listed":true,"notification":"none",
      "status":"normal","role":"manager","created":"2015-08-20T11:59:36+10:00",
      "member":
        {"id":1,"firstname":"John","surname":"Joans","username":"jjones",
         "email":"jjones@allette.com.au","status":"activated",
         "fullname":"John Joans"
         }
      }
    ]
  }

 

CSV

If a service or servlet has CSV listed as one of the outputs at the top of it's documentation then adding .csv to the end of it's URL or the HTTP header Accept:text/csv will return CSV format. This generally returns only a subset of the information returned by the other formats.

For example the URL /service/groups/acme-specs/members.json will return:

Member ID,First name,Surname,Email,Username,Status,Notification,Role,Created
1,John,Joans,jjones@allette.com.au,jjones,normal,none,manager,2015-08-20 11:59:36

Note

For CSV output the 'T' and the timezone have been removed from date fields for compatibility with Microsoft Excel.

Created on , last edited on