---
title: "Bookmark Action"
method: POST
path: "/api/BestBi/MobileApp/bookmarkAction"
tags: ["BestBi"]
---

# Bookmark Action

`POST /api/BestBi/MobileApp/bookmarkAction`

**Function**: `bookmarkAction`  
**Type**: API Endpoint (POST)

**Purpose**:  
This API endpoint allows the user to perform various actions on bookmarks, including creating, fetching, listing, setting as default, renaming, removing default, and deleting a bookmark.

**Endpoint**:  
`POST http://<baseURL>/api/BestBi/MobileApp/bookmarkAction`

**Headers**:  
The request must include the following headers:
- `userCode`: Encoded user code to identify the user making the request.
- `customerKey`: Encoded customer key used to verify the customer's identity.
- `reportCode`: Encoded user code to identify the report to bookmark.

**Request Parameters**:  
The request should specify an `action` parameter to indicate the operation to be performed on the bookmark. The possible values and required fields in the JSON request body are:

**Action Help Info**:
- `0`: Create.
- `1`: Set Default.
- `2`: Rename.
- `3`: Remove Default.
- `4`: Delete Bookmark.

- **create**: Creates a new bookmark.
- **Request Body Fields**:
    - `bookmarkId`: Bookmark identifier.
    - `bookmarkName`: User-friendly name for the bookmark.
    - `bookmarkState`: State information for the bookmark.

- **fetch**: Retrieves a specific bookmark’s state.
- **Request Body Fields**:
    - `bookmarkId`: Identifier of the bookmark to be fetched.

- **list**: Lists all bookmarks associated with a report.
- **Request Body Fields**:
    - `reportname`: Name of the report for which bookmarks should be listed.

- **setdefault**: Sets a bookmark as the default.
- **Request Body Fields**:
    - `bookmarkId`: Identifier of the bookmark to set as default.

- **rename**: Renames a bookmark.
- **Request Body Fields**:
    - `bookmarkId`: Identifier of the bookmark to rename.
    - `bookmarkName`: New name for the bookmark.

- **removedefault**: Removes a bookmark from being the default.
- **Request Body Fields**:
    - `bookmarkId`: Identifier of the bookmark to remove as default.

- **delete**: Deletes a bookmark.
- **Request Body Fields**:
    - `bookmarkId`: Identifier of the bookmark to delete.

**Response**:  
Returns a JSON response with a status message based on the result of the action.

**Response Structure**:  
The response format varies based on the action:
- **create**: Confirmation of bookmark creation.
```json
{
    "message": "Bookmark created successfully"
}
```
- **fetch**: Returns the state of the requested bookmark.
```json
{
    "data": "<Bookmark_State>"
}
```
- **list**: List of all bookmarks for a specific report.
```json
{
    "data": [
        {
            "Bookmark_Id": "<bookmark_id>",
            "Bookmark_Name": "<bookmark_name>",
            "Isdefault": <default_status>
        }
    ]
}
```
- **setdefault**: Confirmation of bookmark being set as default.
```json
{
    "message": "Bookmark set as default"
}
```
- **rename**: Confirmation of successful rename.
```json
{
    "message": "Bookmark renamed successfully"
}
```
- **removedefault**: Confirmation of default status removal.
```json
{
    "message": "Bookmark default removed"
}
```
- **delete**: Confirmation of deletion.
```json
{
    "message": "Bookmark deleted successfully"
}
```

**Notes**:  
- Ensure `userCode`, `customerKey` and `reportCode` headers are valid and provided for the request to succeed.
- Each action must be accompanied by the correct body fields, and missing fields will result in an error.
- This endpoint is intended for managing user-specific bookmarks within the application.

## Headers

- `userCode` string, required
- `customerKey` string, required
- `reportCode` string, required

## Request body

- BookmarkActionRequest
  - `action` integer, required
  - `bookmarkId` string, required
  - `bookmarkName` string, nullable
  - `bookmarkState` string, nullable
  - `isDefault` boolean, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi.md) · [All operations](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/leapsurgebi/leapsurgeapi/revisions/5a6b1464bfeb/schema)
