# Testing Nudges

### Prerequisites

* User/Device should be registered with latest firebaseToken ([here](/integration-doc.md#register-a-device))

```
{
    "userId": "testUser207",
    "userName": "testUser207",
    "appVersion": "4.041",
    "deviceType": "android",
    "deviceName": "Redmi Note 7 Pro",
    "deviceId": "79e87222d4a167d1",
    "firebaseToken": "abcdeghsk",
    "customAttributes": {
        "custom_attributes_a": "a"
    },
    "writeKey": "<writeKey provided by customerGlu>"
}
```

## Send a  Glu nudge to a test device

<mark style="color:green;">`POST`</mark> `https://api.customerglu.com/nudge/v1/send?userId=testusera`

This endpoint allows you to send nudges to test devices which are registered with CustomerGlu

#### Query Parameters

| Name   | Type   | Description                          |
| ------ | ------ | ------------------------------------ |
| userId | string | userId of the user to send the nudge |

#### Headers

| Name      | Type   | Description                       |
| --------- | ------ | --------------------------------- |
| X-API-KEY | string | write key provided by CustomerGlu |

#### Request Body

| Name               | Type   | Description                                   |
| ------------------ | ------ | --------------------------------------------- |
| type               | string | Notification Identifier. Value: "CustomerGlu" |
| glu\_message\_type | string | Accepted values ("in-app", "push")            |
| title              | string | Notification Title                            |
| body               | string | Notification body                             |
| image              | string | Notification Image(Optional)                  |
| nudge\_url         | string | URl to be opened in the webview               |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
    success: true,
    message: "ghchcj/613671371237881278923,
    payload: {
      name: 'CustomerGlu',
      data: {
        type: 'CustomerGlu',
        glu_message_type: 'in-app',
        title: 'Congrats! You are 3 steps away',
        body: 'Tap to see progress',
        image: '',
        nudge_url: 'https://amplify-launcher.dgdcnmnewfrib.amplifyapp.com/program-nudge/multistep-progress/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ0ZXN0VXNlcjIwNCIsImNsaWVudCI6IjcyOTUxMGRmLWI1MjAtNGZlNy04N2NiLTNmNGU4ZTNkMmQ2ZSIsImlhdCI6MTYyMDE0MjM1MywiZXhwIjoxNjUxNjc4MzUzfQ.ftIvv8bTK-r6Xrv1paanuAqR0EueZvm62qipCUTzJXk&campaignId=8c18cc98-697b-466d-9623-21e860ba52f3'
      },
      token: 'blesh'
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.customerglu.com/miscellaneous-topics/notifications/testing-nudges.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
