AgileApps Support Wiki Pre Release

Difference between revisions of "REST API:object Resource"

From AgileApps Support Wiki
imported>Aeric
 
imported>Aeric
m (Text replace - '<tt><nowiki>https://{domain}/networking' to '<tt>{{platformURL}}')
Line 7: Line 7:
;Access Permissions:{{Permissions|Customize Objects|manage Objects}}
;Access Permissions:{{Permissions|Customize Objects|manage Objects}}
;Method:GET
;Method:GET
;URI:<tt><nowiki>https://{domain}/networking/rest/object/{objectName}
;URI:<tt>{{platformURL}}/rest/object/{objectName}
</nowiki></tt>
</nowiki></tt>
;Response:Metadata structure of the Object identified by the [[Object Type Identifier]]
;Response:Metadata structure of the Object identified by the [[Object Type Identifier]]
Line 14: Line 14:
Retrieve all Objects
Retrieve all Objects
;Method:GET
;Method:GET
;URI:<tt><nowiki>https://{domain}/networking/rest/object</nowiki></tt>
;URI:<tt>{{platformURL}}/rest/object</nowiki></tt>
;Response:Metadata structure of the Object identified by the [[Object Type Identifier]]
;Response:Metadata structure of the Object identified by the [[Object Type Identifier]]


Line 25: Line 25:


;Method:POST
;Method:POST
;URI:<tt><nowiki>https://{domain}/networking/rest/object </nowiki></tt>
;URI:<tt>{{platformURL}}/rest/object </nowiki></tt>
;Request:
;Request:
:<syntaxhighlight lang="xml" enclose="div">
:<syntaxhighlight lang="xml" enclose="div">
Line 66: Line 66:
;Method:PUT
;Method:PUT


;URI:<tt><nowiki>https://{domain}/networking/rest/object/{objectName}</nowiki></tt>
;URI:<tt>{{platformURL}}/rest/object/{objectName}</nowiki></tt>


;Request:
;Request:
Line 104: Line 104:
Deletes an object and the metadata that defines it.
Deletes an object and the metadata that defines it.
;Method:DELETE
;Method:DELETE
;URI:<tt><nowiki>https://{domain}/networking/rest/object/{objectName}</nowiki></tt>
;URI:<tt>{{platformURL}}/rest/object/{objectName}</nowiki></tt>
;Response:
;Response:
:<syntaxhighlight lang="xml" enclose="div">
:<syntaxhighlight lang="xml" enclose="div">

Revision as of 21:00, 30 March 2012

The object resource lets you access and modify object metadata (the data that defines object types).

Warn.png

Warning: Information on this page is Provisional.

Retrieve an Object

Identifies and retrieves metadata for the specified object.

Access Permissions

Lock-tiny.gif

Users that have the Customize Objects permission can manage Objects 
Method
GET
URI
https://{yourDomain}/networking/rest/object/{objectName}

</nowiki>

Response
Metadata structure of the Object identified by the Object Type Identifier

Retrieve all Objects

Retrieve all Objects

Method
GET
URI
https://{yourDomain}/networking/rest/object</nowiki>
Response
Metadata structure of the Object identified by the Object Type Identifier

Add an Object

Adds an object.

Considerations
  • Object names:
  • Must start with an alphabetic character.
  • May contain only alphanumeric (a-z A-Z 0-9) and underscores (_).
  • May not contain spaces or other characters.
  • Must be 32 characters or less.
  • When objects are added using REST APIs, they do not have a corresponding data-entry Form that would allow them to be accessed and updated in the GUI. Such forms must be defined using the GUI.
Method
POST
URI
https://{yourDomain}/networking/rest/object </nowiki>
Request
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <object>
       <objectName>AddObjectViaREST</objectName>
       <displayTitle>AddObjectViaRESTApi</displayTitle>
       <singluarDisplayTitle>AddObjectViaRESTApi</singluarDisplayTitle>
       <canTrackActivities>true</canTrackActivities>
       <canTrackNotes>true</canTrackNotes>
       <isActive>true</isActive>
       <isEnabledAsATab>true</isEnabledAsATab>
       <custHelpUrl>www.example.com</custHelpUrl>
       <allowReports>true</allowReports>
       <allowSearch>true</allowSearch>
       <extendedObjectMetaData>REST add</extendedObjectMetaData>
       <description>Adding an Object through REST API</description>
   </object>

</platform> </syntaxhighlight>

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

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <platform>

   <message>
       0
       <description>Success</description>
       <id>34813dcd768740ad91dc4f168023a9cc</id>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Update an Object

Notepad.png

Note: When fields are added to an object using REST APIs, they do not appear in Object Forms. To appear there, they must be specified using the GUI.

Method
PUT
URI
https://{yourDomain}/networking/rest/object/{objectName}</nowiki>
Request
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <object>
       <objectName>AddObjectViaREST</objectName>
       <displayTitle>AddObjectViaRESTApi</displayTitle>
       <singluarDisplayTitle>AddObjectViaRESTApi</singluarDisplayTitle>
       <canTrackActivities>true</canTrackActivities>
       <canTrackNotes>true</canTrackNotes>
       <isActive>true</isActive>
       <isEnabledAsATab>true</isEnabledAsATab>
       <custHelpUrl>www.example.com</custHelpUrl>
       <allowReports>true</allowReports>
       <allowSearch>true</allowSearch>
       <extendedObjectMetaData>Updating a  Object through REST API</extendedObjectMetaData>
       <description>Updating a  Object through REST API</description>
   </object>

</platform> </syntaxhighlight>

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

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <platform>

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

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Delete an Object

Deletes an object and the metadata that defines it.

Method
DELETE
URI
https://{yourDomain}/networking/rest/object/{objectName}</nowiki>
Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

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

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Fields

Note: In this object, Boolean fields accept only 1 or 0 (not TRUE/FALSE).

Name Type Attributes Required During Add Description Additional Information
objectName String Editable on Add/Update Checkmark.gif Object name
displayTitle String Editable on Add/Update Checkmark.gif Display title
singluarDisplayTitle String Editable on Add/Update Checkmark.gif Display title - Singular form
canTrackActivities Boolean Editable on Add/Update Checkmark.gif Flag to track activities
canTrackNotes Boolean Editable on Add/Update Checkmark.gif Flag to track notes and attachments
isActive Boolean Editable on Add/Update Checkmark.gif Flag to set object as active/inactive
isEnabledAsATab Boolean Editable on Add/Update Checkmark.gif Flag to enable object as a tab in the UI
custHelpUrl String Editable on Add/Update Checkmark.gif Custom help URL
allowReports Boolean Editable on Add/Update Checkmark.gif Flag to allow reporting on object
allowSearch Boolean Editable on Add/Update Checkmark.gif Flag to allow searching of object
extendedObjectMetaData String Editable on Add/Update Checkmark.gif Object metadata
description String Editable on Add/Update Checkmark.gif Object description