Views API for Specific API Key
POST/pim/manage/views/:apikey
- Requires Data Manager ApiKey permissions.
- Example URI: https://instancename.piminto.com/api/en-us/pim/manage/views/ApiKey
This API provides functionality for managing and assigning Views to specific API Keys. With these endpoints, you can assign, edit, set a default View, or remove a previously assigned View from an API Key.
To utilize this API, send a POST request with a JSON body. Set the action key in the JSON body to one of the following values:
- listViews: Get a list of all Views assigned to an ApiKey
- addView: Assigning a View to an ApiKey.
The name of the View passed to the API must exist in the PIM's view Dictionary (to create a Vew in the Dictionary, see the "PIM View Dictionary" documentation section)
- editView: Allows you to edit the data that was used for assigning the view.
- setDefault: Change the default View in use
- deleteView: Removed a previously assigned View from an ApiKey.
Use Example Value and Schema for Json requests
Request
Path Parameters
Particular api key.
- application/json
Body
required
Please take note of the following crucial aspects when it comes to managing and assigning Views to specific API Keys:
- addView: The name of the View passed to the API must exist in the PIM's View Dictionary.
- addView, editView The "isDefault" parameter is not passed as all new views are set as NOT default. To mark a view as the default, a separate call should be made.
- deleteView You cannot remove an assigned View from an APIKey if it is set as the 'Default' View. ✔You have the option to assign the 'Default' status to a different view, thereby changing the current view to 'not-Default'.
- List Views
- Add/Edit View
- Set Default View
- Delete View
Possible values: [listViews
]
Possible values: [addView
, editView
]
The name of the PIM View
definition objectrequired
Possible values: [setDefault
]
The name of the PIM View
Possible values: [deleteView
]
The name of the PIM View
Responses
- 200
- default
success
- application/json
- Schema
- Example (from schema)
- List Views
- List Views(when not views)
- Add/Edit View
- Set Default View
- Delete View
Schema
- List Views
- Add/Edit View
- Set Default View
- Delete View
views objectrequired
nameview object
Possible values: [y
, n
]
data objectrequired
definition objectrequired
{}
{
"views": {
"nameview": {
"comment": "My sample view",
"isDefault": "y"
}
},
"status": "OK"
}
{
"status": "OK",
"views": {}
}
{
"status_message": "",
"status": "OK",
"data": {
"name": "nameview",
"definition": {
"comment": "My sample view",
"isDefault": "n"
}
}
}
{
"status": "OK",
"status_message": "View was set to Default!"
}
{
"data": {
"name": "nameview"
},
"status": "OK",
"status_message": ""
}
If there is an error with the API request, additional information will be provided in the response body.
Examples of error messages include:
- addView:
"status_message": "View is unknown! Please add it to Views Dictionary first!"
"status_message": "View with the same name already exist!"
"status_message": "Access denied!"
- editView, deleteView:
"status_message": "View does not exist"
- deleteView:
"status_message": "You can not delete 'Default' view Please set different view as 'Default' then try again."
- application/json
- Schema
- Example (from schema)
Schema
Possible values: [Error
]
The status of the API request. A value of "Error" indicates that the request was not successfully sent or processed.
Provides a message that describes the reason for the error that occurred while processing the API request.
{
"status": "Error",
"status_message": "string"
}