Add a Resource

This API is used to create a new resource. A resource is a logical entity to group one or more ACL managed entities.

URL: /resource

Type: POST

Parameters

Param Type Name Description Field Type
Header sessionId** (or) Token** Use either Session Id or Token received after login String
Header Username Name of the user String
Header Password Password of the user String
Query gwkey Tenant Key. Needed only in case of multi-tenant installations String
Query gwsource** Source from which the request is triggered (for example, web, external) String
Payload name** Name of the resource to create. Name cannot be duplicated. String
Payload description Description of the resource String

** - Mandatory value

Possible Response Message and Code

HTTP Code Description Response Message
400 Bad request Mandatory field 'name' is missing
201 Created Resource added successfully
409 Conflict Resource with the given name already exists
407 Proxy Authentication Required The Username and Password field is mandatory.

Sample Request/Response

Use Case

Add a new resource with the name resource_1.

Request URL

https://appviewxapi.com/avxapi/resource?gwkey=f000ca01&gwsource=external

Request Payload
 {
 "payload": {
 "name": "resource_1",
 "description": "This is a sample resource."
 }
 } 
Response
 {
 "response": "Resource added successfully",
 "message": "Resource added successfully",
 "appStatusCode": null,
 "tags": null,
 "headers": null
 }