# Introduction

{% hint style="warning" %}
The InEvent API URL is now hosted under the **api** subdomain. Requests like `https://inevent.com/api/`should now be sent to `https://api.inevent.com/`

For other regions, please refer to our [Regions guide](https://developers.inevent.com/introduction/regions).

**Please change your environment to reflect this change by December 1st, 2024.**
{% endhint %}

InEvent philosophy is "if there's no REST documentation for this module, it doesn't exist". Since the very beginning of InEvent, every single module has been documented and has its own endpoint available to be used, meaning that you can rebuild the entire platform on top of our REST API.

Before we get started, there are a few concepts of the API we must go through. The API was originally built as an RPC API, a procedural look and feel, that later on got updated to a RESTful API - a simplified version with only `GET` and `POST` methods. Here are two examples for the RPC API and for the RESTful API:

#### RPC way

```sh
curl --request GET \
     --url 'https://api.inevent.com/?action=activity.find&tokenID=YOUR_TOKEN_HERE&eventID=YOUR_EVENT_ID_HERE' \
     --header 'Accept: application/json'
```

#### RESTful way

```sh
curl --request GET \
     --url 'https://api.inevent.com/activity/find?tokenID=YOUR_TOKEN_HERE&eventID=YOUR_EVENT_ID_HERE' \
     --header 'Accept: application/json'
```

All endpoints are supported on both **RPC** and **RESTful** and there are no plans for deprecation. Our `SDK` uses the **RPC** way and this will be the way we will follow throughout the entire documentation.

Once you decide your preferred way to integrate, you must know how to authenticate to our **API**, but to do that, you must know how to run a `POST` operation with contents on the InEvent API. Here is a code example of a `POST` operation and its response:

#### `POST` operation example

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

```sh
curl --request POST \
     --url 'https://api.inevent.com/?action=event.person.operate&tokenID=YOUR_TOKEN_HERE&eventID=YOUR_EVENT_ID_HERE&key=FIELD_HERE' \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/x-www-form-urlencoded' \
     --data value=NEW_VALUE
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.inevent.com/?action=event.person.operate&tokenID=YOUR_TOKEN_HERE&eventID=YOUR_EVENT_ID_HERE&key=FIELD_HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "value=NEW_VALUE",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var axios = require("axios").default;

var options = {
  method: 'POST',
  url: 'https://api.inevent.com/',
  params: {
    action: 'event.person.operate',
    tokenID: 'YOUR_TOKEN_HERE',
    eventID: 'YOUR_EVENT_ID_HERE',
    key: 'YOUR_KEY_HERE'
  },
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  data: {
    value: 'NEW_VALUE'
  }
};

axios.request(options).then(function (response) {
  console.log(response.data);
}).catch(function (error) {
  console.error(error);
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.inevent.com/"

querystring = {
  "action": "event.person.operate",
  "tokenID":"YOUR_TOKEN_HERE",
  "eventID":"YOUR_EVENT_ID_HERE",
  "key":"YOUR_KEY_HERE"
}

payload = "value=NEW_VALUE"
headers = {
    "Accept": "application/json",
    "Content-Type": "application/x-www-form-urlencoded"
}

response = requests.request("POST", url, data=payload, headers=headers, params=querystring)

print(response.text)
```

{% endtab %}
{% endtabs %}

Note that the request body `Content-Type` is always of type `application/x-www-form-urlencoded` and the response will always be of type `application/json`. The response will always respect the structure provided on the example below (with a few exceptions). Here is a response example:

#### Response example

```json
{
  "count": 1,
  "data": [{
    "personID": "string",
    "name": "string",
    "email": "string",
    "headline": "string",
    "image": "string",
    "telephone": "string",
    "city": "string",
    "facebookID": "string",
    "linkedInID": "string",
    "enrollmentID": "string",
    "approved": "string",
    "level": "string",
    "paid": "string",
    "present": "string",
    "private": "string"
  }]
}
```
