> For the complete documentation index, see [llms.txt](https://docs.customerglu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.customerglu.com/miscellaneous-topics/notifications/testing-nudges.md).

# 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
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.customerglu.com/miscellaneous-topics/notifications/testing-nudges.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.
