# Cubo - the counter bot

Check out the [demo page](https://sharity.net/cubo?ref=gitbook) of the Cubo-API.

## POST-Request

<mark style="color:green;">`POST`</mark> `http://api.sharity.net/cubo/`

#### Query Parameters

| Name     | Type    | Description                                                                     |
| -------- | ------- | ------------------------------------------------------------------------------- |
| text     | string  | This string will be checked for any bad things.                                 |
| type     | integer | 1 = Word \| 2 = Sentence                                                        |
| language | string  | Determine the language of the string. Use the country codes: EN, DE, NL, FR ... |
| rating   | number  | Enter a rating between 1 and 10                                                 |

{% tabs %}
{% tab title="200 " %}
{% tabs %}
{% tab title="JSON: Found a counter" %}
{% code title="JSON: Found a counter" %}

```
Error {
    Error occurred:	false
    Error code:	    0
    Error msg:	    ""
},
Status {
    found:	        true
    answer:	        "Underestimate me - that will be funny!"
    answer_id:	    "150"
    answer_voting:	"8.4"
    answer_votes:	"11"
    answer_match:	3
    answer_count:	2
    answer_lang:    "DE"
}
```

{% endcode %}
{% endtab %}

{% tab title="JSON: Found no counter" %}
{% code title="JSON: Found no counter" %}

```
Error {
    Error occurred:	true
    Error code:	    2
    Error msg:	    "Missing Text"
},
Status {
    found:	        false
    answer:	        ""
    answer_id:	    0
    answer_voting:	0
    answer_match:	0
    answer_count:	0
    answer_lang:	"DE"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

## GET-Request

<mark style="color:blue;">`GET`</mark> `http://api.sharity.net/cubo/?text=comment&language=EN&rating=5&type=1`

Call this URL for the API via a GET request

#### Query Parameters

| Name     | Type    | Description                                                                     |
| -------- | ------- | ------------------------------------------------------------------------------- |
| text     | string  | This string will be checked for any bad things.                                 |
| type     | integer | 1 = Word \| 2 = Sentence                                                        |
| language | string  | Determine the language of the string. Use the country codes: EN, DE, NL, FR ... |
| rating   | number  | Enter a rating between 1 and 10                                                 |

{% tabs %}
{% tab title="200 If the request was successfull" %}
{% tabs %}
{% tab title="JSON - Found a counter" %}
{% code title="JSON - Found a counter" %}

```
Error {
    Error occurred:	false
    Error code:	    0
    Error msg:	    ""
},
Status {
    found:	        true
    answer:	        "Underestimate me - that will be funny!"
    answer_id:	    "150"
    answer_voting:	"8.4"
    answer_votes:	"11"
    answer_match:	3
    answer_count:	2
    answer_lang:    "DE"
}
```

{% endcode %}
{% endtab %}

{% tab title="JSON: Found no counter" %}
{% code title="JSON: Found no counter" %}

```
Error {
    Error occurred:	true
    Error code:	    2
    Error msg:	    "Missing Text"
},
Status {
    found:	        false
    answer:	        ""
    answer_id:	    0
    answer_voting:	0
    answer_match:	0
    answer_count:	0
    answer_lang:	"DE"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}
