# Authenticatie, invoer en resultaat

### Condition score opvragen

## Plaats een URL om de conditiescore van badkamers en keukens op te halen.

<mark style="color:green;">`POST`</mark> `https://api.altum.ai/condition-score/url`

#### Headers

| Name                                        | Type   | Description                                                                     |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------- |
| x-api-key<mark style="color:red;">\*</mark> | string | Unieke API-sleutel van Altum. Maak er een via Mopsus(<https://mopsus.altum.ai>) |
| Content-Type                                | string | application/json                                                                |

#### Request Body

| Name                                  | Type   | Description                                                           |
| ------------------------------------- | ------ | --------------------------------------------------------------------- |
| url<mark style="color:red;">\*</mark> | string | De openbare URL van de afbeelding die u in het verzoek wilt verzenden |

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

```
{
	"Output": {
		"label": "bathroom",
		"confidence": "98.17",
		"condition_score": "4.09"
	}
}
```

{% endtab %}

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

```
{
  "detail": "The URL is not valid"
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity Verkeerd invoerformaat" %}

```
{
	"detail": [
		{
			"loc": [
				"body",
				"image"
			],
			"msg": "field required",
			"type": "value_error.missing"
		}
	]
}
```

{% endtab %}

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

```
{
    'Output': 'Please use https://api.altum.ai or visit https://mopsus.altum.ai to make your request.'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Service is not available and/or down" %}

```
{
	"message": "Internal server error"
}
```

{% endtab %}

{% tab title="403: Forbidden Verboden" %}

```
{
	"message": "Missing Authentication Token"
}
```

{% endtab %}
{% endtabs %}

## Upload een afbeeldingsbestand om de conditiescore van badkamers en keukens op te halen.

<mark style="color:green;">`POST`</mark> `https://api.altum.ai/condition-score/img`

#### Headers

| Name                                        | Type   | Description                                                              |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------ |
| x-api-key<mark style="color:red;">\*</mark> | string | API-sleutel van Altum. Maak er een via Mopsus(<https://mopsus.altum.ai>) |
| Content-Type                                | string | multipath/form-data                                                      |

#### Request Body

| Name                                    | Type   | Description                                                                                                |
| --------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------- |
| image<mark style="color:red;">\*</mark> | object | De afbeelding die in de aanvraag moet worden verzonden, moet als multipath/form-data-type worden geüpload. |

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

```
{
	"Output": {
		"label": "bathroom",
		"confidence": "98.17",
		"condition_score": "4.09"
	}
}
```

{% endtab %}

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

```
{
  "detail": "Please upload an image with one of the following formats: .jpg, .jpeg or .png"
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity Verkeerd invoerformaat" %}

```
{
	"detail": [
		{
			"loc": [
				"body",
				"image"
			],
			"msg": "field required",
			"type": "value_error.missing"
		}
	]
}
```

{% endtab %}

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

```
{
    'Output': 'Please use https://api.altum.ai or visit https://mopsus.altum.ai to make your request.'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Service is niet beschikbaar en/of niet beschikbaar" %}

```
{
	"message": "Internal server error"
}
```

{% endtab %}

{% tab title="403: Forbidden Verboden" %}

```
{
	"message": "Missing Authentication Token"
}
```

{% endtab %}
{% endtabs %}

## GRATIS Ping voor beschikbaarheid

## Plaats de URL om te bevestigen of de afbeelding een keuken of een badkamer bevat.

<mark style="color:green;">`POST`</mark> `https://api.altum.ai/condition-score/url/ping`

Met dit eindpunt kunt u verifiëren of een afbeelding een badkamer of keuken laat zien voordat u de conditiescores opvraagt. Deze voorafgaande controle is nodig omdat de Condition Score API geen scores kan genereren als de afbeelding geen keuken of badkamer weergeeft.

#### Headers

| Name                                        | Type   | Description                                                              |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------ |
| x-api-key<mark style="color:red;">\*</mark> | string | API-sleutel van Altum. Maak er een via Mopsus(<https://mopsus.altum.ai>) |
| Content-Type                                | string | application/json                                                         |

#### Request Body

| Name                                  | Type   | Description                                                           |
| ------------------------------------- | ------ | --------------------------------------------------------------------- |
| url<mark style="color:red;">\*</mark> | string | De openbare URL van de afbeelding die u in het verzoek wilt verzenden |

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

```
{
    "Output": {
    "label": "Bathroom or Kitchen image detected",
    "confidence": "98.17"
    }        
}
```

{% endtab %}

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

```
{
  "detail": "The URL is not valid"
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity Verkeerd invoerformaat" %}

```
{
	"detail": [
		{
			"loc": [
				"body",
				"image"
			],
			"msg": "field required",
			"type": "value_error.missing"
		}
	]
}
```

{% endtab %}

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

```
{
    'Output': 'Please use https://api.altum.ai or visit https://mopsus.altum.ai to make your request.'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Service is niet beschikbaar en/of niet beschikbaar" %}

```
{
	"message": "Internal server error"
}
```

{% endtab %}

{% tab title="403: Forbidden Verboden" %}

```
{
	"message": "Missing Authentication Token"
}
```

{% endtab %}
{% endtabs %}

## Upload image file to confirm if the image contains a kitchen or a bathroom.

<mark style="color:green;">`POST`</mark> `https://api.altum.ai/condition-score/img/ping`

Met dit eindpunt kunt u verifiëren of een afbeelding een badkamer of keuken laat zien voordat u de conditiescores opvraagt. Deze voorafgaande controle is nodig omdat de Condition Score API geen scores kan genereren als de afbeelding geen keuken of badkamer weergeeft.

#### Headers

| Name                                        | Type   | Description                                                              |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------ |
| x-api-key<mark style="color:red;">\*</mark> | string | API-sleutel van Altum. Maak er een via Mopsus(<https://mopsus.altum.ai>) |
| Content-Type                                | string | multipath/form-data                                                      |

#### Request Body

| Name                                    | Type   | Description                                                                                                |
| --------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------- |
| image<mark style="color:red;">\*</mark> | object | De afbeelding die in de aanvraag moet worden verzonden, moet als multipath/form-data-type worden geüpload. |

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

```
{
    "Output": {
    "label": "Bathroom or Kitchen image detected",
    "confidence": "98.17"
    }        
}
```

{% endtab %}

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

```
{
  "detail": "Please upload an image with one of the following formats: .jpg, .jpeg or .png"
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity Verkeerd invoerformaat" %}

```
{
	"detail": [
		{
			"loc": [
				"body",
				"image"
			],
			"msg": "field required",
			"type": "value_error.missing"
		}
	]
}
```

{% endtab %}

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

```
{
    'Output': 'Please use https://api.altum.ai or visit https://mopsus.altum.ai to make your request.'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Service is niet beschikbaar en/of niet beschikbaar" %}

```
{
	"message": "Internal server error"
}
```

{% endtab %}

{% tab title="403: Forbidden Verboden" %}

```
{
	"message": "Missing Authentication Token"
}
```

{% endtab %}
{% endtabs %}

## Request body

#### Voorbeeld verzoek

```
{"url":"https://www.rawsonhomes.com.au/-/media/rawson-homes/blogs-external-banner-images/blog-articles/2020-blogs/september-2020/facades/narraweena-nara-facade.ashx"}
```
