> For the complete documentation index, see [llms.txt](https://edocyberar1.gitbook.io/tukar-pulsa-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edocyberar1.gitbook.io/tukar-pulsa-api/master.md).

# Login

## Simpan/Update Data Pengguna

<mark style="color:green;">`POST`</mark> `https://tukar.co.id/api/v1/login`

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Authorization | string | Token Otentikasi |

#### Request Body

| Name              | Type   | Description    |
| ----------------- | ------ | -------------- |
| login\_oauth\_uid | string | ID Pengguna    |
| first\_name       | string | Nama           |
| last\_name        | string | Nama           |
| email\_address    | string | Email Pengguna |
| profile\_picture  | string | Foto Profile   |
| time              | string | Format time()  |

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

```
{
    "data": {
        "code": 200,
        "status": "update", //update atau insert
        "login_oauth_uid": "123456789", //google_client ID
        "first_name": "ENDO", //google_client name
        "last_name": "SUGENTO", //google_client name
        "email_address": "enddwer@gmail.com", //google_client email
        "profile_picture": "https://lh3.googleusercontent.com/a-/MsvdkkeqdfJw_GpSSapQ=s96-c", //google_client picture
        "time": "2021-06-21 16:16:55"
    }
}
```

{% endtab %}

{% tab title="403 " %}

```
{
    "data": {
        "code": 403,
        "message": "Akses tidak dikenali"
    }
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "data": {
        "code": 404,
        "message": "Parameter tidak sah"
    }
}
```

{% endtab %}
{% endtabs %}

## Mengambil Data Pengguna

<mark style="color:blue;">`GET`</mark> `https://tukar.co.id/api/v1/login`

#### Path Parameters

| Name              | Type   | Description |
| ----------------- | ------ | ----------- |
| login\_oauth\_uid | string | ID pengguna |

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Authorization | string | Token Otentikasi |

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

```
{
    "data": {
        "code": 200,
        "login_oauth_uid": "123456789",
        "first_name": "ENDO",
        "last_name": "SUGENTO",
        "email_address": "enddwer@gmail.com",
        "profile_picture": "https://lh3.googleusercontent.com/a-/MsvdkkeqdfJw_GpSSapQ=s96-c",
        "count_trx": 6
    }
}
```

{% endtab %}

{% tab title="403 " %}

```
{
    "data": {
        "code": 403,
        "message": "Akses tidak dikenali"
    }
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "data": {
        "code": 404,
        "message": "Akun tidak ditemukan"
    }
}
```

{% endtab %}
{% endtabs %}
