UserFavoriteExpert

Moduł odpowiedzialny za wybieranie ubublionych wdrożeniowców przez klientów - listowanie, tworzenie, usuwanie.

Endpointy obsługujące żądanie:

  • https://api.client.5ways.com

Pobieranie listy ulubionych wdrożeniowców

GET /rest/user_favorite_expert

Zwraca listę ulubionych wdrożeniowców.

Zwracane dane
HTTP/1.1 200 OK
{
    "total": 2,
    "links": {
        "self": "https://api.client.respondo.pl/rest/user_favorite_expert",
        "first": "https://api.client.respondo.pl/rest/user_favorite_expert",
        "previous": "https://api.client.respondo.pl/rest/user_favorite_expert?page=",
        "next": "https://api.client.respondo.pl/rest/user_favorite_expert?page=2",
        "last": "https://api.client.respondo.pl/rest/user_favorite_expert?page=1"
    },
    "results": [
        {
            "UserFavoriteExpert": {
                "id": "1",
                "user_client_id": "6173",
                "implementer_id": "6108",
                "created": "2024-12-10 10:12:51",
                "modified": "2024-12-10 10:12:51"
            }
        },
        {
            "UserFavoriteExpert": {
                "id": "2",
                "user_client_id": "6173",
                "implementer_id": "6109",
                "created": "2024-12-10 10:22:51",
                "modified": "2024-12-10 10:22:51"
            }
        }
    ]
}

Pobieranie wybranego ulubionego wdrożeniowca

GET /rest/user_favorite_expert?implementer_id=6108

Zwraca parę ID ulubionego wdrożeniowca oraz ID klienta który go polubił jeśli taka para istnieje

Zwracane dane
HTTP/1.1 200 OK
{
    "total": 1,
    "links": {
        "self": "https://api.client.respondo.pl/rest/user_favorite_expert?implementer_id=6108",
        "first": "https://api.client.respondo.pl/rest/user_favorite_expert",
        "previous": "https://api.client.respondo.pl/rest/user_favorite_expert?page=",
        "next": "https://api.client.respondo.pl/rest/user_favorite_expert?page=2",
        "last": "https://api.client.respondo.pl/rest/user_favorite_expert?page=1"
    },
    "results": [
        {
            "UserFavoriteExpert": {
                "id": "1",
                "user_client_id": "6173",
                "implementer_id": "6108",
                "created": "2024-12-10 10:12:51",
                "modified": "2024-12-10 10:12:51"
            }
        }
    ]
}

Dodawanie ulubionego wdrożeniowca

POST /rest/user_favorite_expert

Tworzy ulubionego wdrożeniowca na zasadzie złącznia ID klienta z ID wdrożeniowca

Treść żądania
{
    "UserFavoriteExpert": {
        "user_client_id": "6173",
        "implementer_id": "6110"
    }
}
Odpowiedź

Zwraca obiekt z id nowo utworzonego ulubionego wdrożeniowca przypisanego do klienta, który go polubił.

HTTP/1.1 201 Created
{
    "id": "2",
    "user_client_id": "6173",
    "implementer_id": "6110",
    "created": "2024-12-11 10:43:26",
    "modified": "2024-12-11 10:43:26"
}

Usuwanie użytkownika

DELETE /rest/user_favorite_expert/{id}

Trwale usuwa ubulionego wdrożeniowca z tabeli łączącej ID klienta i ID wdrożeniowca

Odpowiedź
HTTP/1.1 200 OK
{
    "status": "OK"
}