# Get Furnitures

### Endpoint

<mark style="color:blue;">`GET`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

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

```json
[
  "interior": [
        {
            "id": "closet",
            "name": "Armoire / Garde-robe",
            "name_en": "Wardrobe",
            "name_es": "Guardarropa",
            "name_pt": "Guarda-roupa",
            "name_de": "Garderobe",
            "type": "interior"
        },

        {
            "id": "round_dining_table",
            "name": "Table ronde",
            "name_en": "Round dining table",
            "name_es": "Mesa redonda",
            "name_pt": "Mesa redonda",
            "name_de": "Runder Tisch",
            "type": "interior"
        },
        ....
    ],
    "bathroom": [
        {
            "id": "bathtub",
            "name": "Baignoire",
            "name_en": "Bathtub",
            "name_es": "Bañera",
            "name_pt": "Banheira",
            "name_de": "Badewanne",
            "type": "bathroom"
        },
        ....
    ],
    ...
]
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

{% tab title="500: Internal Server Error " %}

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/furnitures' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'GET',
  headers: myHeaders
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures"

payload = {}
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];

$request = new Request('GET', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures"
  method := "GET"

  client := &http.Client {}
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{API_KEY}}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"

response = https.request(request)
puts response.read_body
```

{% endtab %}
{% endtabs %}
