# Example: Netcore RCS API

Lets explore how to add Netcore's Template RCS API to

## Pre-requisites

* Netcore's API documentation: [https://cpaasdocs.netcorecloud.com/docs/netcore-google-rcs-api-documentation/149c89ae6aae0-template-message-api](https://cpaasdocs.netcorecloud.com/docs/netcore-google-rcs-api-documentation/149c89ae6aae0-template-message-api)
* The API Key of the account.

## Setting up the API

**Step 1:** Go to > Campaigns > Channels > RCS

**Step 2:** Click on "Add New RCS API"

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FlfYGjQv09ugPZ13oSRYB%2Fimage.png?alt=media&#x26;token=54621ed3-2907-4c93-a056-2200c430d090" alt=""><figcaption></figcaption></figure>

**Step 3:** Basic details

1. Name of configuration: The name you entered in the previous step will be displayed here
2. Description: Add a description for your new RCS client.

**Step 4:** API Details

You can set up the Netcore API in the same way as you set up an[ External API](../external-api) with a global payload.&#x20;

1. **HTTP Method:** Select the HTTP method as POST
2. **API URL:** Provide the Netcore RCS API URL.&#x20;
3. Also, You can simply import the cURL of the API and skip to the next step! Let's understand how "Detect from cURL" works.
4. Clicking the **+detect from URL** button will pop up the following window.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FLGL6hnQZUb9KMjWg7WEh%2Fimage.png?alt=media&#x26;token=6e7aa878-ac28-49c2-bed0-5625d1dbca6d" alt=""><figcaption><p><em>Image: cURL</em></p></figcaption></figure>

5. Once you enter the curl, it will automatically fetch the Headers and Payload from the API and populate in the relevant fields and the tree view will occur based on the values in the payload.
6. After the API is broken down into it's respective components, input your account's **API Key,** in the header param "api\_key"

**Step 5:** Assigning mandatory fields

* Assign message.0.to with To\* as the recipient mobile number will go here.
* Assign messages.0.content.templateCode with Template ID\* as the RCS template ID will go here.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FhLE50FatH4KGClWm8RsJ%2Fimage.png?alt=media&#x26;token=84a981ea-b02d-4d8f-bd10-867bcf8a8531" alt=""><figcaption><p><em>Image: Select Configuration value</em> </p></figcaption></figure>

**Step 6:** configuring personalisation parameters object

1. In Netcore RCS API, `message.0.content.attributes` is the path that consumes the template's personalisation parameters in the form of key:value pairs.
2. Select the edit icon in the above node.
3. Give an appropriate display name.
4. Define it as optional and select the drop index as "Pass empty".

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FYaC8VIGC9Q0KP9nK9NZF%2FLemniskApp-GoogleChrome2024-04-0212-01-16-ezgif.com-video-to-gif-converter%20(2).gif?alt=media&#x26;token=a4d3eb99-497a-46ac-82ba-77e4bc6c24d0" alt=""><figcaption><p><em>Image: Configure attributes in engagement level</em> </p></figcaption></figure>

## **Test  API**

* Navigate to > Test API
* Assign values to the payload and click "test"
* You will receive the confirmation as shown below once your API is validated&#x20;

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FD1JP7ApZHBRZai9m6sB7%2Fimage.png?alt=media&#x26;token=4edeb70b-a0f6-432c-a2bf-e71f1981f515" alt=""><figcaption><p><em>Image: Test Configuration</em></p></figcaption></figure>

This is the same functionality we implemented in External API. Click [here](../external-api/test-your-api-configuration) to know in detail.

## Response and Webhooks

The response and Webhooks screen is where you will map the relevant path of the response body to the internal MessageID identifier which supports Lemnisk to identify every message trigger and map its delivery report.

* Navigate to > Response and Webhooks
* Enter values to the payload and Click "Test Configuration"
* You will receive the response from the vendor when triggered successfully.
* Select `message.messageID` - this is path of the messageID in the API response.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FGxftLrR69STHKePjo1HI%2Fimage.png?alt=media&#x26;token=4a7d4a21-2465-4645-bda3-6b9548ba7e17" alt=""><figcaption><p><em>Image: Response and Webhooks</em></p></figcaption></figure>

{% hint style="success" %}
Congratulations! Netcore Template RCS API is successfully configured for you. You can now proceed to create engagements on this client.
{% endhint %}

