AgileApps Support Wiki Pre Release

Difference between revisions of "REST API:index Resource"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 2: Line 2:


:''Learn more:'' REST API [[REST API#Conventions and Considerations|Conventions and Considerations]].
:''Learn more:'' REST API [[REST API#Conventions and Considerations|Conventions and Considerations]].
{{Note|Use this structure the same way you use the structure for man pages:<br/>Follow the presentation pattern, but if a section isn't needed, don't include the header.<br/>Also:
# Add an entry to the [[REST API:REST API CheatSheet|REST API CheatSheet]]
# Add an entry to the [[REST API]] (categorized) page
# Add an entry to the [[REST API:REST Resources (alphabetical)|REST Resources]] page
}}


===Requirements===
===Requirements===
Line 156: Line 150:
:<syntaxhighlight lang="xml" enclose="div">
:<syntaxhighlight lang="xml" enclose="div">
<platform>
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
</syntaxhighlight>
:See also: [[REST API:Error Codes]]
===Dynamic Search for __resourceName__ Records===
;Method:GET
;URI:<tt><nowiki>https://{domain}/networking/rest/__resourceName__?{query_parameters}</nowiki></tt>
{{:REST API:Dynamic Search}}
;Response:
:<syntaxhighlight lang="xml" enclose="div">
<platform>
    ....
     <message>
     <message>
         <code>0</code>
         <code>0</code>
Line 204: Line 179:
|-
|-
| tag || String || align="center"|Writable on Add only || align="center"|[[File:Checkmark.gif|link=]] || description || AddlInfo
| tag || String || align="center"|Writable on Add only || align="center"|[[File:Checkmark.gif|link=]] || description || AddlInfo
|-
| ...|| ... || ... || ... || ... || ...
|-
| ...|| ... || ... || ... || ... || ...
|-
| colspan="6"  bgcolor="Azure" style="height:7px" |  <!-- SPACER ROW -->
|-
| date_modified || Date || align="center"|Read Only || || || [[UTC Format]]
|-
| date_created || Date || align="center"|Read Only || || || [[UTC Format]]
|-
| created_id || Lookup || align="center"|Read Only  || || || [[REST API:User Resource|User]] ID
|-
| modified_id || Lookup || align="center"|Read Only || || || [[REST API:User Resource|User]] ID
|}
-or-
:{| border="1" cellpadding="5" cellspacing="0"
! Name !! Type !! Attribute !! Default Value !! Description !! Additional Information
|-
| tag || String || align="center"|Read Only || Default || description || AddlInfo
|-
| tag || String ||  || Default || description || AddlInfo
|-
|-
| ...|| ... || ... || ... || ... || ...
| ...|| ... || ... || ... || ... || ...

Revision as of 20:26, 15 February 2012

Manage __resourceName__ (record)s using the REST API.

Learn more: REST API Conventions and Considerations.

Requirements

  • Requirement #1
  • Requirement #2

Permissions

__TBD: Are the permission(s) right?__ -- check Administrative Permissions for a list of possibilities

Lock-tiny.gif

Users that have the Access Control/User Management permission can use this resource. 

Lock-tiny.gif

Users that have the Manage Develop Features permission can use this resource. 

List All __resourceName__ (Record)s

("Get" if complete records are returned. "List" if partial data is returned, requiring a second read to get a complete set of data. This comes before the GET, because typically it's called first to get the ID used in a specific-record GET.)

Method
GET
URI
https://{domain}/networking/rest/__resourceName__
Return all fields
URI
https://{domain}/networking/rest/__resourceName__?{query_parameters}
Query Parameters
Introductory sentence, if any
  • parameter1 - Description
  • parameter2
  • If TRUE, ...
  • If FALSE, ...
For more information, see: Specifying Query Parameters in REST APIs
Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <__resourceName__>
       <id>...</id>
       <field>data</field>
        ...
   </__resourceName__>
   <__resourceName__>
        ...
   </__resourceName__>
    ...
   <message>
       0
       <description>Success</description>
   </message>
   <recordCount>N</recordCount>      

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Get a __resourceName__ Record

Method
GET
URI
https://{domain}/networking/rest/__resourceName__/{recordId}
Return all fields
URI
https://{domain}/networking/rest/__resourceName__/{recordId}?{query_parameters}
Query Parameters
Introductory sentence, if any
  • parameter1 - Description
  • parameter2
  • If true, ...
  • If false, ... (default)
For more information, see: Specifying Query Parameters in REST APIs
Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <__resourceName__>
       <id>...</id>
       <field>data</field>
        ...
   </__resourceName__>
   <message>
       0
       <description>Success</description>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Add a __resourceName__ Record

Method
POST
URI
https://{domain}/networking/rest/__resourceName__
Request
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <__resourceName__>
       <field>data</field>
        ...
   </__resourceName__>

</platform> </syntaxhighlight>

Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <message>
       0
       <description>Success</description>
       <id>...</id>   
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Update a __resourceName__ Record

Method
PUT
URI
https://{domain}/networking/rest/__resourceName__/{recordId}
Request
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <__resourceName__>
       <id>{recordId}</id>
        ...
   </__resourceName__>

</platform> </syntaxhighlight>

Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <message>
       0
       <description>Success</description>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Delete a __resourceName__ Record

Method
DELETE
URI
https://{domain}/networking/rest/__resourceName__/{recordId}
Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <message>
       0
       <description>Success</description>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Fields

Note: Unless otherwise indicated, the attribute for a field is "Editable on Add or Update".
Name Type Attribute Required on Add Description Additional Information
id String Read Only Record Id
name String Checkmark.gif
description String
... ... ... ... ... ...
tag String Read Only description AddlInfo
tag String description AddlInfo
tag String Checkmark.gif description AddlInfo
tag String Writable on Add only Checkmark.gif description AddlInfo
... ... ... ... ... ...
... ... ... ... ... ...
date_modified Date Read Only UTC Format
date_created Date Read Only UTC Format
created_id Lookup Read Only User ID
modified_id Lookup Read Only User ID