# by ID

<mark style="color:blue;">`GET`</mark> `https://us-central1-appgregator.cloudfunctions.net/twitter/users/user-by-id/`

#### Query Parameters

| Name                                               | Type   | Description                                                       |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark>             | String | qantor.co.id                                                      |
| connection\_name<mark style="color:red;">\*</mark> | String | twitter-1                                                         |
| id<mark style="color:red;">\*</mark>               | String | 2621412174,783214,2244994945,6253282,495309159,172020392,95731075 |

#### Headers

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

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

```javascript
{
    "data": [
        {
            "id": "2621412174",
            "name": "Pranksy 📦",
            "username": "pranksy"
        },
        {
            "id": "783214",
            "name": "Twitter",
            "username": "Twitter"
        },
        {
            "id": "2244994945",
            "name": "Twitter Dev",
            "username": "TwitterDev"
        },
        {
            "id": "6253282",
            "name": "Twitter API",
            "username": "TwitterAPI"
        },
        {
            "id": "495309159",
            "name": "Twitter New York City",
            "username": "TwitterNYC"
        },
        {
            "id": "172020392",
            "name": "Twitter San Francisco",
            "username": "TwitterSF"
        },
        {
            "id": "95731075",
            "name": "Twitter Safety",
            "username": "TwitterSafety"
        }
    ]
}
```

{% endtab %}

{% tab title="400: Bad Request 400 Bad Request - Too Many Users" %}

```javascript
{
    "errors": [
        {
            "parameters": {
                "ids": [
                    "783214,2244994945,6253282,495309159,172020392,95731075,2548985366,277761722,17874544,300392950,87532773,372575989,3260518932,121291606,158079127,3282859598,103770785,586198217,216531294,1526228120,222953824,1603818258,2548979088,2244983430,1347713256,376825877,6844292,738118115595165697,738118487122419712,218984871,2550997820,1159458169,2296297326,234489024,3873936134,2228891959,791978718,427475002,1194267639100723200,1168976680867762177,905409822,738115375477362688,88723966,1049385226424786944,284201599,1705676064,2861317614,3873965293,1244731491088809984,4172587277,717465714357972992,862314223,2551000568,2548977510,1159274324,783214,2244994945,6253282,495309159,172020392,95731075,2548985366,277761722,17874544,300392950,87532773,372575989,3260518932,121291606,158079127,3282859598,103770785,586198217,216531294,1526228120,222953824,1603818258,2548979088,2244983430,1347713256,376825877,6844292,738118115595165697,738118487122419712,218984871,2550997820,1159458169,2296297326,234489024,3873936134,2228891959,791978718,427475002,1194267639100723200,1168976680867762177,905409822,738115375477362688,88723966,1049385226424786944,284201599,1705676064,2861317614,3873965293,1244731491088809984,4172587277,717465714357972992,862314223,2551000568,2548977510,1159274324"
                ]
            },
            "message": "size [110] is not between 1 and 100"
        }
    ],
    "title": "Invalid Request",
    "detail": "One or more parameters to your request was invalid.",
    "type": "https://api.twitter.com/2/problems/invalid-request"
}
```

{% endtab %}

{% tab title="200: OK User Not Found" %}

```javascript
{
    "errors": [
        {
            "detail": "Could not find user with id: [2244994946].",
            "title": "Not Found Error",
            "resource_type": "user",
            "parameter": "id",
            "value": "2244994946",
            "type": "https://api.twitter.com/2/problems/resource-not-found"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

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

```shell
curl --location --request GET 'https://us-central1-appgregator.cloudfunctions.net/twitter/users/user-by-id?name=qantor.co.id&connection_name=twitter-1&id=2621412174,783214,2244994945,6253282,495309159,172020392,95731075' \
--header 'x-api-key: 43c464439b5507293ba7b315c9875907'
```

{% endtab %}

{% tab title="NodeJs - Axios" %}

```javascript
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://us-central1-appgregator.cloudfunctions.net/twitter/users/user-by-id?name=qantor.co.id&connection_name=twitter-1&id=2621412174,783214,2244994945,6253282,495309159,172020392,95731075',
  headers: { 
    'x-api-key': '43c464439b5507293ba7b315c9875907'
  }
};

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

```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/twitter/users/user-by-id?name=qantor.co.id&connection_name=twitter-1&id=2621412174,783214,2244994945,6253282,495309159,172020392,95731075',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: 43c464439b5507293ba7b315c9875907'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}
{% endtabs %}
