# API from server

## Authorization :

<mark style="color:green;">`POST`</mark> `https://api.Conscent.club/reward/{partner_id}/api/user_event`

Header: {API Key}

#### Path Parameters

| Name                                          | Type   | Description                       |
| --------------------------------------------- | ------ | --------------------------------- |
| partner\_id<mark style="color:red;">\*</mark> | String | Unique Identifier for the Partner |

#### Request Body

| Name                                        | Type   | Description             |
| ------------------------------------------- | ------ | ----------------------- |
| RAW\_BODY<mark style="color:red;">\*</mark> | Object | Provide an Event Object |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="shell" %}

```sh
curl --request POST \
     --url https://api.Conscent.club/reward/partner_id/api/user_event \
     --header 'X-API-KEY: {API Key}' \
     --header 'accept: text/plain' \
     --header 'content-type: application/json' \
     --data '
{
  "eventType": "ORDER_PLACED",
  "userId": "42bede01c83fa3947"
}
'
```

{% endtab %}

{% tab title="javaScript" %}

```javascript
const options = {
  method: 'POST',
  headers: {
    accept: 'text/plain',
    'content-type': 'application/json',
    'X-API-KEY': '{API Key}'
  },
  body: JSON.stringify({eventType: 'ORDER_PLACED', userId: '42bede01c83fa3947'})
};

fetch('https://api.Conscent.club/reward/partner_id/api/user_event', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
```

{% endtab %}

{% tab title="php" %}
**Installation:**

```php
$ composer require guzzlehttp/guzzle
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.Conscent.club/reward/partner_id/api/user_event', [
  'body' => '{"eventType":"ORDER_PLACED","userId":"42bede01c83fa3947"}',
  'headers' => [
    'X-API-KEY' => '{API Key}',
    'accept' => 'text/plain',
    'content-type' => 'application/json',
  ],
]);

echo $response->getBody();
```

{% endtab %}

{% tab title="Node" %}
**Installation:**

<pre><code><strong>$ npm install api --save
</strong></code></pre>

```
const request = require('request');

const options = {
  method: 'POST',
  url: 'https://api.Conscent.club/reward/partner_id/api/user_event',
  headers: {
    accept: 'text/plain',
    'content-type': 'application/json',
    'X-API-KEY': '{API Key}'
  },
  body: {eventType: 'ORDER_PLACED', userId: '42bede01c83fa3947'},
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
```

{% 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.conscent.ai/loyalty-system/api-from-server.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.
