# 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 %}
