Difference between revisions of "REST API:applicationAccess Resource"
From AgileApps Support Wiki
imported>Aeric (→Fields) |
imported>Aeric |
||
(35 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
===Permissions=== | ===Permissions=== | ||
{{ | {{PermissionRef|Access Control|use this resource.}} | ||
<!--Never Implemented | <!--Never Implemented | ||
===List Application Access Records=== | ===List Application Access Records=== | ||
Line 10: | Line 10: | ||
;Method:GET | ;Method:GET | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/applicationAccess</nowiki></tt> | ;URI:<tt><nowiki>https://{{domain}}/networking/rest/applicationAccess</nowiki></tt> | ||
;Response: | ;Response: | ||
Line 28: | Line 28: | ||
<description>Success</description> | <description>Success</description> | ||
</message> | </message> | ||
<recordCount>N</recordCount> <! | <recordCount>N</recordCount> <!.. Number of __ records returned ..> | ||
</platform> | </platform> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 34: | Line 34: | ||
:See also: [[REST API:Error Codes]] | :See also: [[REST API:Error Codes]] | ||
--> | --> | ||
===Get an Application Access Record=== | ===Get an Application Access Record=== | ||
;Method:GET | ;Method:GET | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/applicationAccess/{applicationId}</nowiki></tt> | ;URI:<tt><nowiki>https://{{domain}}/networking/rest/applicationAccess/{applicationId}</nowiki></tt> | ||
{{Tip|<br>To get the id of application access record from the GUI, go to the [[Application Access]] page and modify the view to include the Record ID field.}} | |||
;Response: | ;Response: | ||
:<syntaxhighlight lang="xml" enclose="div"> | :<syntaxhighlight lang="xml" enclose="div"> | ||
<platform> | <platform> | ||
<applicationAccess> | |||
<applicationId>348f933bf0dc4bfeb5a8e8ade2bb145e</applicationId> | |||
<applicationName>Order Management</applicationName> | |||
< | <accessTo> | ||
< | <type>USER</type> | ||
< | <id>b2e935fc454a4c45815c3b0ffb0b9869</id> | ||
< | <name>Aaron Acme</name> | ||
<roles> | |||
<role> | |||
<id>7d74139597b945dd8b712084c61dae05</id> | |||
<name>Manager</name> | |||
</role> | |||
< | <role> | ||
... | |||
</role> | |||
... | |||
</roles> | |||
</accessTo> | |||
<accessTo> | |||
... | |||
</accessTo> | |||
... | |||
</applicationAccess> | |||
<message> | |||
<code>0</code> | |||
<description>Success</description> | |||
</message> | |||
</platform> | </platform> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 71: | Line 81: | ||
;Method:POST | ;Method:POST | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/applicationAccess</nowiki></tt> | ;URI:<tt><nowiki>https://{{domain}}/networking/rest/applicationAccess/{applicationId}</nowiki></tt> | ||
;Request: | ;Request: | ||
:<syntaxhighlight lang="xml" enclose="div"> | :<syntaxhighlight lang="xml" enclose="div"> | ||
<platform> | <platform> | ||
<applicationAccess> | |||
<applicationId>...</applicationId> | |||
<accessTo> | |||
<type>USER</type> | |||
<id>...</id> | |||
<roles> | |||
<role> | |||
<id>...</id> | |||
</role> | |||
<role> | |||
... | |||
</role> | |||
... | |||
</roles> | |||
</accessTo> | |||
<accessTo> | |||
... | ... | ||
</accessTo> | |||
... | |||
</applicationAccess> | |||
</platform> | </platform> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 88: | Line 115: | ||
<code>0</code> | <code>0</code> | ||
<description>Success</description> | <description>Success</description> | ||
<id>...</id> <!-- ID of the newly created applicationAccess --> | <id>...</id> <!-- ID of the newly created applicationAccess record --> | ||
</message> | </message> | ||
</platform> | </platform> | ||
Line 98: | Line 125: | ||
;Method:PUT | ;Method:PUT | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/applicationAccess/{ | ;URI:<tt><nowiki>https://{{domain}}/networking/rest/applicationAccess/{applicationId}</nowiki></tt> | ||
;Request: | ;Request: | ||
:<syntaxhighlight lang="xml" enclose="div"> | :<syntaxhighlight lang="xml" enclose="div"> | ||
<platform> | <platform> | ||
<applicationAccess> | |||
<applicationId>...</applicationId> | |||
<accessTo> | |||
<type>USER</type> | |||
<id>...</id> | |||
<roles> | |||
<role> | |||
<id>...</id> | |||
</role> | |||
<role> | |||
... | |||
</role> | |||
... | |||
</roles> | |||
</accessTo> | |||
<accessTo> | |||
... | |||
</accessTo> | |||
... | |||
</applicationAccess> | |||
</platform> | </platform> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
:* The application-access record for the specified application is updated. | |||
:* New <tt>accessTo</tt> elements are added. | |||
:* An <tt>accessTo</tt> element with a matching <tt>type</tt> and <tt>id</tt> is ''replaced''. | |||
:: (The list of roles specified in the update-record replaces the existing list of roles.) | |||
;Response: | ;Response: | ||
Line 125: | Line 174: | ||
;Method:DELETE | ;Method:DELETE | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/applicationAccess/{ | ;URI:<tt><nowiki>https://{{domain}}/networking/rest/applicationAccess/{applicationId}/{respective UserId or TeamId}</nowiki></tt> | ||
{{Note|The UserId or TeamId is the Id which you want to delete from Application Access for a specific User or Team.}} | |||
;Response: | ;Response: | ||
:<syntaxhighlight lang="xml" enclose="div"> | :<syntaxhighlight lang="xml" enclose="div"> | ||
Line 142: | Line 191: | ||
;Method:GET | ;Method:GET | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/applicationAccess?{query_parameters}</nowiki></tt> | ;URI:<tt><nowiki>https://{{domain}}/networking/rest/applicationAccess?{query_parameters}</nowiki></tt> | ||
:;Example: List all records, and all of their fields: | |||
:::<tt><nowiki>https://{{domain}}/networking/rest/applicationAccess?fieldList=*</nowiki></tt> | |||
{{:REST API:Dynamic Search}} | {{:REST API:Dynamic Search}} | ||
Line 148: | Line 199: | ||
:<syntaxhighlight lang="xml" enclose="div"> | :<syntaxhighlight lang="xml" enclose="div"> | ||
<platform> | <platform> | ||
.... | <record> | ||
<id>8e657280c4a084857a212313e029c49</id> | |||
<application_id>0c848119d6a343d88a3302164fb41a1b</application_id> | |||
<created_id type="" ... | |||
uri="https://{{domain}}/networking/rest/user/3" | |||
displayValue=" System">3</created_id> | |||
<modified_id type="" | |||
uri="https://{{domain}}/networking/rest/user/3" | |||
displayValue=" System">3</modified_id> | |||
<date_modified>2012-07-02</date_modified> | |||
<date_created>2012-07-02</date_created> | |||
</record> | |||
<record> | |||
... | |||
</record> | |||
... | |||
<message> | <message> | ||
<code>0</code> | <code>0</code> | ||
Line 161: | Line 227: | ||
:{| border="1" cellpadding="5" cellspacing="0" | :{| border="1" cellpadding="5" cellspacing="0" | ||
! Name !! Type !! Attribute !! Description !! Additional Information | ! colspan="4"| Name !! Type !! Attribute !! Description !! Additional Information | ||
|- | |||
| colspan="4"| id || String || || This record's ID || | |||
|- | |||
| colspan="4"| application_id<br>applicationId || String || || The ID of an application || | |||
|- | |- | ||
| | | colspan="4"| applicationName || String || align="center"|Read Only || The application name || | ||
|- | |- | ||
| | | colspan="4"| accessTo || container || || || | ||
|- | |- | ||
| | | || colspan="3"| type || String || || The kind of entity granted access (user or team) || Values: | ||
:<tt>USER</tt> or | :<tt>USER</tt> or | ||
:<tt>TEAM</tt> | :<tt>TEAM</tt> | ||
|- | |- | ||
| | | || colspan="3"| id || String || || The ID of the [[REST API:User Resource|user]] or [[REST API:Team Resource|team]] || | ||
|- | |||
| || colspan="3"| name || String || align="center"|Read Only || The name of the User or Team || | |||
|- | |||
| || colspan="3"| roles || Container || || || | |||
|- | |||
| || || colspan="2"| role || Container || || || | |||
|- | |||
| || || || id || String || || The ID of a [[REST API:Role Resource|role]] the user or team member can assume in the application|| | |||
|- | |- | ||
| | | || || || name || String || align="center"|Read Only || The name of the role || | ||
|- | |- | ||
| colspan=" | | colspan="8" bgcolor="Azure" style="height:7px" | <!-- SPACER ROW --> | ||
|- | |- | ||
| date_modified || Date || align="center"|Read Only || || [[UTC Format]] | | colspan="4"| date_modified || Date || align="center"|Read Only || || [[UTC Format]] | ||
|- | |- | ||
| date_created || Date || align="center"|Read Only || || [[UTC Format]] | | colspan="4"| date_created || Date || align="center"|Read Only || || [[UTC Format]] | ||
|- | |- | ||
| created_id || Lookup || align="center"|Read Only || || [[REST API:User Resource|User]] ID | | colspan="4"| 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 | | colspan="4"| modified_id || Lookup || align="center"|Read Only || || [[REST API:User Resource|User]] ID | ||
|} | |} | ||
Latest revision as of 09:13, 27 January 2017
Manage Application Access records using the REST API.
- Learn more: REST API Conventions and Considerations.
Permissions
Users that have the Access Control permission can use this resource..
Get an Application Access Record
- Method
- GET
- URI
- https://{{domain}}/networking/rest/applicationAccess/{applicationId}
Tip:
To get the id of application access record from the GUI, go to the Application Access page and modify the view to include the Record ID field.
- Response
<platform> <applicationAccess> <applicationId>348f933bf0dc4bfeb5a8e8ade2bb145e</applicationId> <applicationName>Order Management</applicationName> <accessTo> <type>USER</type> <id>b2e935fc454a4c45815c3b0ffb0b9869</id> <name>Aaron Acme</name> <roles> <role> <id>7d74139597b945dd8b712084c61dae05</id> <name>Manager</name> </role> <role> ... </role> ... </roles> </accessTo> <accessTo> ... </accessTo> ... </applicationAccess> <message> <code>0</code> <description>Success</description> </message> </platform>
- See also: REST API:Error Codes
Add an Application Access Record
- Method
- POST
- URI
- https://{{domain}}/networking/rest/applicationAccess/{applicationId}
- Request
<platform> <applicationAccess> <applicationId>...</applicationId> <accessTo> <type>USER</type> <id>...</id> <roles> <role> <id>...</id> </role> <role> ... </role> ... </roles> </accessTo> <accessTo> ... </accessTo> ... </applicationAccess> </platform>
- Response
<platform> <message> <code>0</code> <description>Success</description> <id>...</id> <!-- ID of the newly created applicationAccess record --> </message> </platform>
- See also: REST API:Error Codes
Update an Application Access Record
- Method
- PUT
- URI
- https://{{domain}}/networking/rest/applicationAccess/{applicationId}
- Request
<platform> <applicationAccess> <applicationId>...</applicationId> <accessTo> <type>USER</type> <id>...</id> <roles> <role> <id>...</id> </role> <role> ... </role> ... </roles> </accessTo> <accessTo> ... </accessTo> ... </applicationAccess> </platform>
- The application-access record for the specified application is updated.
- New accessTo elements are added.
- An accessTo element with a matching type and id is replaced.
- (The list of roles specified in the update-record replaces the existing list of roles.)
- Response
<platform> <message> <code>0</code> <description>Success</description> </message> </platform>
- See also: REST API:Error Codes
Delete an Application Access Record
- Method
- DELETE
- URI
- https://{{domain}}/networking/rest/applicationAccess/{applicationId}/{respective UserId or TeamId}
- Response
<platform> <message> <code>0</code> <description>Success</description> </message> </platform>
- See also: REST API:Error Codes
Dynamic Search for Application Access Records
- Method
- GET
- URI
- https://{{domain}}/networking/rest/applicationAccess?{query_parameters}
- Example
- List all records, and all of their fields:
- https://{{domain}}/networking/rest/applicationAccess?fieldList=*
- Query Parameters
- fieldList - A comma-separated list of field names to retrieve
- The asterisk (*) wildcard specifies all fields
- {fieldname} specifies an individual field (e.g. name)
- (Use the REST API:field Resource to get a complete list of fields.)
- For a Composite Object, specify {alias}.{fieldname} to select a related-record field, where the alias is defined in the Object Relationships.
- For a Database View, specify {alias}.{fieldname}, where the object alias is defined in the Database View.
- alias.* specifies all fields in the aliased object.
- filter - Filtering criteria to filter the records
- For more examples, see Filter Expressions in REST APIs and the REST API Examples.)
- pageSize - Number of records to retrieve from the result set in order to make a "page".
- page - Number of the logical page in a database result set. The first page is page "zero" (0).
- Page zero is returned by default, so appending &pageSize=1 to your query returns a single record.
- getTotalRecordCount returns the number of total records.
Causes the following structure to be returned, where N is the total number of records:
<platform> <status> <packageDeploy> ... </packageDeploy> </status> <message> <code>0</code> <description>Success</description> </message> <!-- added by the query param --> <totalRecordCount>N</totalRecordCount> </platform>
- sortBy - Field name for primary sort
Ex: &sortBy=name - sortOrder - Sort order of the primary field, either asc or desc (ascending or descending)
Ex: &sortOrder=desc - sortBy2 - Field name for secondary sort
- sortOrder2 - Sort order of the second field, either asc or desc (ascending or descending)
- sortBy - Field name for primary sort
- For more information, see: Specifying Query Parameters in REST APIs
- Response
<platform> <record> <id>8e657280c4a084857a212313e029c49</id> <application_id>0c848119d6a343d88a3302164fb41a1b</application_id> <created_id type="" ... uri="https://{{domain}}/networking/rest/user/3" displayValue=" System">3</created_id> <modified_id type="" uri="https://{{domain}}/networking/rest/user/3" displayValue=" System">3</modified_id> <date_modified>2012-07-02</date_modified> <date_created>2012-07-02</date_created> </record> <record> ... </record> ... <message> <code>0</code> <description>Success</description> </message> </platform>
- See also: REST API:Error Codes
Fields
Name Type Attribute Description Additional Information id String This record's ID application_id
applicationIdString The ID of an application applicationName String Read Only The application name accessTo container type String The kind of entity granted access (user or team) Values: - USER or
- TEAM
id String The ID of the user or team name String Read Only The name of the User or Team roles Container role Container id String The ID of a role the user or team member can assume in the application name String Read Only The name of the role 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
Error Codes
Platform Code with Http Status Description -7000 BAD_REQUEST (400) Invalid ID
Learn more:
- See the REST API:Error Codes for common Http error codes
- See the javadoc constants for a complete list of PlatformException error-code constants.