> For the complete documentation index, see [llms.txt](https://api.govtech.esempla.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.govtech.esempla.systems/sso/api-partner.md).

# API Partner

## Inspectam Statutul Organizatiei

<mark style="color:blue;">`GET`</mark> `https://sso.esempla.systems/api/v1/checkToken`

#### Path Parameters

| Name          | Type   | Description                                        |
| ------------- | ------ | -------------------------------------------------- |
| Authorization | string | <p>Metoda de audentificare<br>"Bearer Token"</p>   |
| Token         | string | indicam Tokenul, creat prin metoda "/api/v1/login" |

#### Headers

| Name      | Type   | Description                   |
| --------- | ------ | ----------------------------- |
| partnerid | string | Identificatorul Provaiderului |

{% tabs %}
{% tab title="200 Exemplu rezultatului corect" %}

```javascript
{
    "organization": {
        "name": "TES1",
        "idno": "123",
        "status_id": 1,
        "description": "",
        "project": "test"
    },
    "status": true
}
```

{% endtab %}

{% tab title="401 Probleme in Token, este setat incorect." %}

```
{
    "name": "Unauthorized",
    "message": "Your request was made with invalid credentials.",
    "code": 0,
    "status": 401
}
```

{% endtab %}

{% tab title="403 Problema in Identificator, este setat incorect" %}

```
{
    "name": "Forbidden",
    "message": "",
    "code": 0,
    "status": 403
}
```

{% endtab %}

{% tab title="404 Problema cu metoda, este setata incorect." %}

```
{
    "name": "Not Found",
    "message": "Page not found.",
    "code": 0,
    "status": 404,
    "previous": {
        "name": "Invalid Route",
        "message": "Unable to resolve the request \"v1/checkToke\".",
        "code": 0
    }
}
```

{% endtab %}
{% endtabs %}

## Inspectam Organizatia, care apartine anumitui Provaider

<mark style="color:blue;">`GET`</mark> `https://sso.esempla.systems/api/v1/getOrganizations`

#### Headers

| Name      | Type   | Description                   |
| --------- | ------ | ----------------------------- |
| partnerid | string | Identificatorul Provaiderului |

{% tabs %}
{% tab title="200 Exemplu rezultatului corect" %}

```
"Rezultatul - 1"
{
    "status": true,
    "organizations": []
}

"Rezultatul - 2"
{
    "status": true,
    "organizations": {
        "testOrganization2": {
            "name": "testOrganization2",
            "idno": "12345",
            "status": true,
            "description": "aDQADCWAWAEWEFDWAEFASFFfsafdgsdgvv"
        }
    }
}
```

{% endtab %}

{% tab title="403 Problema cu Identificatorul, este setat incorect" %}

```
{
    "name": "Forbidden",
    "message": "",
    "code": 0,
    "status": 403
}
```

{% endtab %}

{% tab title="404 Problema cu metoda, este setata incorect" %}

```
{
    "name": "Not Found",
    "message": "Page not found.",
    "code": 0,
    "status": 404,
    "previous": {
        "name": "Invalid Route",
        "message": "Unable to resolve the request \"v1/getOrganization\".",
        "code": 0
    }
}
```

{% endtab %}
{% endtabs %}

## &#x20;Inspectam Proectul, care apartine animitui Provaider

<mark style="color:blue;">`GET`</mark> `https://sso.esempla.systems/api/v1/getProjects`

#### Headers

| Name      | Type   | Description                   |
| --------- | ------ | ----------------------------- |
| partnerid | string | Identificatorul Provaiderului |

{% tabs %}
{% tab title="200 Exemplul rezultatului corect" %}

```
"Rezultatul - 1"
{
    "status": true,
    "projects": []
}

"Rezultatul -2"
{
    "status": true,
    "projects": {
        "testProject2": {
            "name": "testProject2",
            "organization": "testOrganization2",
            "organization_idno": "12345",
            "description": "dcvsvcsdevseve",
            "status": true
        }
    }
}
```

{% endtab %}

{% tab title="403 Problema cu Identificatorul, este setat ioncorect" %}

```
{
    "name": "Forbidden",
    "message": "",
    "code": 0,
    "status": 403
}
```

{% endtab %}

{% tab title="404 Problema cu metoda, esta setata incorect" %}

```
{
    "name": "Not Found",
    "message": "Page not found.",
    "code": 0,
    "status": 404,
    "previous": {
        "name": "Invalid Route",
        "message": "Unable to resolve the request \"v1/getProject\".",
        "code": 0
    }
}
```

{% endtab %}
{% endtabs %}

## Vizionam lista Provaiderilor

<mark style="color:blue;">`GET`</mark> `https://sso.esempla.systems/api/v1/getProviders`

#### Headers

| Name      | Type   | Description                   |
| --------- | ------ | ----------------------------- |
| partnerid | string | Identificatorul Provaiderului |

{% tabs %}
{% tab title="200 Exemplul rezultatului corect" %}

```
{
    "tetsProvider2": {
        "provider_id": 3,
        "relation_class_attributes": null,
        "description": ""
    },
    "tetsProvider1": {
        "provider_id": 1,
        "relation_class_attributes": null,
        "description": ""
    },
    "test with attribute": {
        "provider_id": 2,
        "relation_class_attributes": {
            "test": null
        },
        "description": ""
    }
}
```

{% endtab %}

{% tab title="403 Problema cu Identificatorul, este setat incorect" %}

```
{
    "name": "Forbidden",
    "message": "",
    "code": 0,
    "status": 403
}
```

{% endtab %}

{% tab title="404 Problema cu metoda, este setat incorect" %}

```
{
    "name": "Not Found",
    "message": "Page not found.",
    "code": 0,
    "status": 404,
    "previous": {
        "name": "Invalid Route",
        "message": "Unable to resolve the request \"v1/getProvider\".",
        "code": 0
    }
}
```

{% endtab %}
{% endtabs %}

## Vizionam Provaiderii care ii apartin unei Organizatii

<mark style="color:green;">`POST`</mark> `https://sso.esempla.systems/api/v1/getProvidersByProject`

#### Headers

| Name      | Type   | Description                   |
| --------- | ------ | ----------------------------- |
| partnerid | string | Identificatorul Provaiderului |

#### Request Body

| Name        | Type   | Description         |
| ----------- | ------ | ------------------- |
| Project\_id | string | Id -ul organizatiei |

{% tabs %}
{% tab title="200 Exemplul rezultatului corect" %}

```
lista provaiderilor care apartin unei organizatii
{
    "status": true,
    "providers": {
        "tetsProvider1": {
            "provider": "tetsProvider1",
            "relation_class": null,
            "status": true
        },
        "tetsProvider2": {
            "provider": "tetsProvider2",
            "relation_class": null,
            "status": true
        }
    }
}

rezultatul, cin nu exista organizatie cu proect_id indicat
{
    "status": true,
    "providers": []
}
```

{% endtab %}

{% tab title="403 Problema cu partnerid, este setat incorect" %}

```
{
    "name": "Forbidden",
    "message": "",
    "code": 0,
    "status": 403
}
```

{% endtab %}

{% tab title="404 Problema cu metoda este setata incorect" %}

```
{
    "name": "Not Found",
    "message": "Page not found.",
    "code": 0,
    "status": 404,
    "previous": {
        "name": "Invalid Route",
        "message": "Unable to resolve the request \"v1/getProvidersByProjec\".",
        "code": 0
    }
}
```

{% endtab %}
{% endtabs %}
