> For the complete documentation index, see [llms.txt](https://docs.sharinpix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sharinpix.com/documentation/integrations/events/configure-server-side-events.md).

# Configure Server-side Events

The current article demonstrates how to configure Server-side SharinPix Events.

{% hint style="success" %}
**Tip:**

For more information about the types of server-side events, you can refer to the following article:

[Types of SharinPix Events](/documentation/integrations/events/types-of-sharinpix-events.md).
{% endhint %}

{% hint style="warning" %}
**Note:**

1. The following sections make use of Webhooks.

In order to use Webhooks, you should ensure that you have granted API access to SharinPix on your organization. To verify this, go to the **SharinPix Settings** tab and check if the second row, that is, **Sharinpix - > Salesforce full API access**, is highlighted in green.

In case the row, **Sharinpix - > Salesforce full API access** is still highlighted in red, simply click on the **Grant** button to grant API access.

For more detailed information on how to grant API access, please refer the the following article:

[Basic Setup - Step 2 - Register your Salesforce organization to SharinPix](/getting-started/basic-setup/basic-setup-step-2-register-your-salesforce-organization-to-sharinpix.md)

2. All Webhooks of type **apex\_method** make use of Salesforce API and should be used only when needed.
   {% endhint %}

## Configure Server-side Events

* Access the SharinPix Admin Dashboard to configure a server-side event.
* Select the **'Webhooks'** menu item from the navigation bar.
* Click on the **'New Webhook'** button.
* Select your current **Salesforce Organization**.
* Select whether to execute an **Apex method** or **make a request to a specific endpoint.**
* Select the type of event to be detected.

<figure><img src="/files/TKUXFjV0wiW2n4xRVzX7" alt=""><figcaption></figcaption></figure>

* Click on **Create V2**, when you are done.

## Webhook in action

The objective of this section is to show how to detect the **New Image** event and call an Apex Method found on the SharinPix Package. The **New Image** event is triggered when a new image is added to a SharinPix Album. After detecting this event, the **newImage** method from the **ImageSyncMigration** class will be called and therefore perform a **resync** on the newly-added image.

* The Webhook is configured as shown in the screenshot below where the method to be executed and the event that triggers this execution, are specified.

![](/files/sIYK95BOeKOTjx0zsLFE)

* In this context, the related list of SharinPix Images and the SharinPix Album is present on the page-layout and page of the Account Object respectively.
* A new image is added to the SharinPix Album as shown below.

<figure><img src="/files/qLZKIZnEzXObAFprNpvd" alt=""><figcaption></figcaption></figure>

* Once the image has been uploaded, you need to refresh the current page. A new entry in the SharinPix Images related list has been added as shown in the image below.

<figure><img src="/files/hDEpvnDMZBhGLdasqqHS" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sharinpix.com/documentation/integrations/events/configure-server-side-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
