# Registration

## how to work?

create a register form

![](/files/SjsDuzCiromAA8uOgp6M)

add an onclick event handler on the submit button, where shall I declare the onClick event function which calls axios or accepts variable in this code

**Understanding Axios POST requests**

If you click the submit button, you will get a response in your console with a `201` status code telling you the `POST` request was successful created.

<mark style="color:green;">`POST`</mark> `https://us-central1-appgregator.cloudfunctions.net/api/education/edutama/frontend/academy/user-registration/`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | wkFBUJNQV;C |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
    "status": true,
    "message": "Successfully create user",
    "data": "680|UEdZhh4nXUzDl9j5BQ7hKwlGWmcNRbVVyWP25g5a"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Body JSON" %}

```
{
    "name":"qantor.co.id",
    "platform_id":4,
    "connection_name":"entrepreneurs.id-02",
    "user_name": "imam2",
    "email": "sschouse@gmail.com",
    "password": "qwerty",
    "package": 16,
    "referal": "",
    "profesi" : "",
    "birth_date": "2022-06-06"
}
```

{% endtab %}

{% tab title="CURL" %}

```shell
curl --location --request POST 'https://us-central1-appgregator.cloudfunctions.net/api/education/edutama/frontend/academy/user-registration' \
--header 'x-api-key: wkFBUJNQV;C' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name":"qantor.co.id",
    "platform_id":4,
    "connection_name":"entrepreneurs.id-02",
    "user_name": "imam2",
    "email": "sschouse@gmail.com",
    "password": "qwerty",
    "package": 16,
    "referal": "",
    "profesi" : "",
    "birth_date": "2022-06-06"
}'
```

{% endtab %}

{% tab title="NODE JS" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "name": "qantor.co.id",
  "platform_id": 4,
  "connection_name": "entrepreneurs.id-02",
  "user_name": "imam2",
  "email": "sschouse@gmail.com",
  "password": "qwerty",
  "package": 16,
  "referal": "",
  "profesi": "",
  "birth_date": "2022-06-06"
});

var config = {
  method: 'post',
  url: 'https://us-central1-appgregator.cloudfunctions.net/api/education/edutama/frontend/academy/user-registration',
  headers: { 
    'x-api-key': 'wkFBUJNQV;C', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="REACT" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "name": "qantor.co.id",
  "platform_id": 4,
  "connection_name": "entrepreneurs.id-02",
  "user_name": "imam2",
  "email": "sschouse@gmail.com",
  "password": "qwerty",
  "package": 16,
  "referal": "",
  "profesi": "",
  "birth_date": "2022-06-06"
});

var config = {
  method: 'post',
  url: 'https://us-central1-appgregator.cloudfunctions.net/api/education/edutama/frontend/academy/user-registration',
  headers: { 
    'x-api-key': 'wkFBUJNQV;C', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});ja
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/api/education/edutama/frontend/academy/user-registration',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "name":"qantor.co.id",
    "platform_id":4,
    "connection_name":"entrepreneurs.id-02",
    "user_name": "imam2",
    "email": "sschouse@gmail.com",
    "password": "qwerty",
    "package": 16,
    "referal": "",
    "profesi" : "",
    "birth_date": "2022-06-06"
}',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: wkFBUJNQV;C',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}

{% tab title="PHYTON http-client" %}

```python
import http.client
import json

conn = http.client.HTTPSConnection("us-central1-appgregator.cloudfunctions.net")
payload = json.dumps({
  "name": "qantor.co.id",
  "platform_id": 4,
  "connection_name": "entrepreneurs.id-02",
  "user_name": "imam2",
  "email": "sschouse@gmail.com",
  "password": "qwerty",
  "package": 16,
  "referal": "",
  "profesi": "",
  "birth_date": "2022-06-06"
})
headers = {
  'x-api-key': 'wkFBUJNQV;C',
  'Content-Type': 'application/json'
}
conn.request("POST", "/api/education/edutama/frontend/academy/user-registration", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

{% 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://edrus.gitbook.io/appgregator-api-docs/appgregators/education/academy/edutama/api/users/registration.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.
