> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CollaborationService

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/5/app-studio/reference/services/lightning.CollaborationService

[mintlify link]: https://doc.lucidworks.com/docs/5/app-studio/reference/services/lightning.CollaborationService

[old doc.lw link]: https://doc.lucidworks.com/app-studio/4.2/1215

<LwTemplate />

## Description

Appkit service for accessing Appkit Collaboration API's

## Methods

### delete(annotation, platform, id)

Deletes an annotation

#### Parameters

| Param      | Type   | Details                                                                                                                                                                                                                                                                                  |
| ---------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| annotation | string | The type of collaboration annotation to delete. Valid values are:<br />**comment** - For deleting a comment.<br />**bookmark** - For deleting a bookmark.<br />**topic** - For deleting a topic.<br />**link** - For deleting a like.<br />**saved-query** - For deleting a saved-query. |
| platform   | string | The name of the platform.                                                                                                                                                                                                                                                                |
| id         | string | The ID of the annotation to be deleted.                                                                                                                                                                                                                                                  |

#### Returns

|             |                                                                              |
| ----------- | ---------------------------------------------------------------------------- |
| HttpPromise | Returns a promise which will resolve depending on the response from the API. |

#### Example

```js wrap  theme={"dark"}
CollaborationService.delete('comment', 'platform', 123456);
```

### getCommentAddedEventName(target, topic, collection)

Method for returning the event emitted when a comment is added

#### Parameters

| Param                   | Type   | Details                                   |
| ----------------------- | ------ | ----------------------------------------- |
| target                  | string | The comment target.                       |
| topic *(optional)*      | string | The topic associated to the comment.      |
| collection *(optional)* | string | The collection associated to the comment. |

#### Returns

|        |                                      |
| ------ | ------------------------------------ |
| string | The event name that will be emitted. |

#### Example

```js wrap  theme={"dark"}
CollaborationService.getCommentAddedEventName(target, collection, topic);
```

### post(annotation, platform, data)

Creates an annotation

#### Parameters

| Param      | Type   | Details                                                                                                                                                                                                                                                                                  |
| ---------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| annotation | string | The type of collaboration annotation to delete. Valid values are:<br />**comment** - For creating a comment.<br />**bookmark** - For creating a bookmark.<br />**topic** - For creating a topic.<br />**link** - For creating a like.<br />**saved-query** - For creating a saved-query. |
| platform   | string | The name of the platform.                                                                                                                                                                                                                                                                |
| data       | object | The data object for creating the required annotation.                                                                                                                                                                                                                                    |

#### Returns

|             |                                                                              |
| ----------- | ---------------------------------------------------------------------------- |
| HttpPromise | Returns a promise which will resolve depending on the response from the API. |

#### Example

```js wrap  theme={"dark"}
CollaborationService.post('comment', 'platform', data);
```

### query(annotation, platform, target, collection, topic, results)

Gets an array of Collaboration Annotations (comments, likes, topics or bookmarks) based on the options provided.

#### Parameters

| Param                   | Type   | Details                                                                                                                                                                                                                                                                                                 |
| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| annotation              | string | The type of collaboration annotation you are searching for. Valid values are: **comments** - Returns a list of comments  **bookmarks** - Returns a list of bookmarks  **topics** - Returns a list of topics  **links** - Returns a list of likes.  **saved-queries** - Returns a list of saved-queries. |
| platform                | string | The name of the platform.                                                                                                                                                                                                                                                                               |
| target *(optional)*     | string | When provided it will return only annotations associated with this target (not applicable to topics).                                                                                                                                                                                                   |
| collection *(optional)* | string | When provided it will return only annotations associated with this collection (not applicable to topics).                                                                                                                                                                                               |
| topic *(optional)*      | string | When provided it will return only annotations associated with this topic (not applicable to topics).                                                                                                                                                                                                    |
| results *(optional)*    | number | The number of annotations to return.                                                                                                                                                                                                                                                                    |

#### Returns

|             |                                                                              |
| ----------- | ---------------------------------------------------------------------------- |
| HttpPromise | Returns a promise which will resolve depending on the response from the API. |

#### Example

```js wrap  theme={"dark"}
CollaborationService.query('comments', 'platform', 'foo-bar');
```
