### User Login Request and Response Source: https://documenter.getpostman.com/view/41568417/2sAYX5MNgD/index This snippet demonstrates how to log in a user to the OtaSync API. It includes the request body format with authentication token, username, and password, as well as an example of a successful response containing user information and a PKEY for authorization. The PKEY is crucial for all subsequent API calls. ```json { "token":"a5666bee05b0fa91afc5c2f56a6cdcfd57a58c89", "username": "[YOUR_USERNAME]", "password": "[YOUR_PASSWORD]", "remember": 0 } ``` ```json { "id_users": 50199, "id_parent": 0, "status": "confirmed", "username": "djordje.tornjanski@otasync.me", "pwd": "97802bc919615ac05415140b61729bd4192bcc2e", "name": "Djordje", "email": "djordje.tornjanski@otasync.me", "phone": "+381637294859", "address": null, "city": null, "zip": null, "company": null, "country": "RS", "pib": null, "mb": null, "undo_timer": 60, "notify_overbooking": 0, "notify_new_reservations": 0, "notify_for_new_properties_or_units_added": 1, "id_users_access_groups": 0, "created_by": 0, "reservations": 3, "guests": 3, "invoices": 3, "prices": 3, "restrictions": 3, "avail": 3, "rooms": 3, "channels": 3, "statistics": 3, "calendar": 3, "changelog": 3, "articles": 3, "storn_invoice": 3, "reports": 3, "allow_add_properties": 1, "expenses": 3, "omni_channel": 1, "inventory": 1, "engine": 3, "settings": "3", "contigents": 0, "show_overbookings_and_unassigned_reservations": 1, "guest_check_out_invoice": "none", "undo_timer_account": "60", "theme": null, "default_language_account": "rs", "company_address": null, "send_email_in_case_of_overbooking": "1", "show_company_address_on_invoice": null, "send_email_for_new_reservations": "1", "send_offer_reminder_to_user": 1, "send_email_to_guests": null, "wubook_connected": -1, "bnovo_connected": 0, "channex_connected": 0, "last_activity": "2025-02-07 15:45:01", "phone_verified": 1, "email_verified": 0, "enable_2fa": 1, "2fa_type": "phone", "suspended": 0, "monthly_price": 0, "source": "web", "agency": 0, "agency_commission": 0, "registration_number": null, "user_without_email": 0, "id_resellers": null, "create_channex_group": 0, "id_channex_groups": "", "subscription_end_date": "2024-12-01", "type": "standard", "onboarded": 0, "is_dummy": 1, "payment_required": 1, "number_of_units": 5, "disable_credit_card": 0, "suspened": 0, "hear_about_us": "", "notes": null, "birth": null, "package": "no_selected", "allow_add_users": 1, "delete_reservation": 1, "onboarded_by_role": null, "onboarded_by_role_id": null, "is_deleted": 0, "date_deleted": null, "date_modified": "2025-02-07 15:45:01", "date_created": "2024-11-17 22:23:58", "pkey": "aef67742d092b285bb81e9ee65c17e0e884371fd", "properties": [ { "name": "Oasis", "id_properties": "6577" }, { "name": "Fares", "id_properties": "6579" }, { "name": "Sokratis", "id_properties": "7099" } ] } ``` -------------------------------- ### User Login cURL Example Source: https://documenter.getpostman.com/view/41568417/2sAYX5MNgD/index This snippet provides a cURL command to perform a user login to the OtaSync API. It specifies the endpoint, content type, and the raw data payload including the authentication token, username, and password. ```bash curl --location 'https://app.otasync.me/api/user/auth/login' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-raw '{ "token":"a5666bee05b0fa91afc5c2f56a6cdcfd57a58c89", "username": "djordje.tornjanski@otasync.me", "password": "Pekapro122342134.", "remember": 0 }' ``` -------------------------------- ### User Login API Source: https://documenter.getpostman.com/view/41568417/2sAYX5MNgD/index This endpoint handles user authentication. Upon successful authentication, it returns user information and an authorization key (pkey) for subsequent requests. ```APIDOC ## POST /api/user/auth/login ### Description Authenticates a user with provided credentials and returns user information along with an authorization key. ### Method POST ### Endpoint https://app.otasync.me/api/user/auth/login ### Parameters #### Request Body - **token** (string, required) - A token for authentication. - **username** (string, required) - The user's username. - **password** (string, required) - The user's password. - **remember** (integer, optional) - A flag to remember the user's session (e.g., 0 for no, 1 for yes). ### Request Example ```json { "token":"a5666bee05b0fa91afc5c2f56a6cdcfd57a58c89", "username": "[YOUR_USERNAME]", "password": "[YOUR_PASSWORD]", "remember": 0 } ``` ### Response #### Success Response (200) - **id_users** (integer) - The user's unique identifier. - **id_parent** (integer) - The parent user's identifier. - **status** (string) - The user's account status. - **username** (string) - The user's username. - **pwd** (string) - The hashed user password. - **name** (string) - The user's name. - **email** (string) - The user's email address. - **phone** (string) - The user's phone number. - **address** (string or null) - The user's address. - **city** (string or null) - The user's city. - **zip** (string or null) - The user's zip code. - **country** (string) - The user's country code. - **pkey** (string) - The authorization key for subsequent requests. - **properties** (array) - A list of properties accessible by the user, each with `name` and `id_properties`. #### Response Example ```json { "id_users": 50199, "id_parent": 0, "status": "confirmed", "username": "djordje.tornjanski@otasync.me", "pwd": "97802bc919615ac05415140b61729bd4192bcc2e", "name": "Djordje", "email": "djordje.tornjanski@otasync.me", "phone": "+381637294859", "address": null, "city": null, "zip": null, "company": null, "country": "RS", "pib": null, "mb": null, "undo_timer": 60, "notify_overbooking": 0, "notify_new_reservations": 0, "notify_for_new_properties_or_units_added": 1, "id_users_access_groups": 0, "created_by": 0, "reservations": 3, "guests": 3, "invoices": 3, "prices": 3, "restrictions": 3, "avail": 3, "rooms": 3, "channels": 3, "statistics": 3, "calendar": 3, "changelog": 3, "articles": 3, "storn_invoice": 3, "reports": 3, "allow_add_properties": 1, "expenses": 3, "omni_channel": 1, "inventory": 1, "engine": 3, "settings": "3", "contigents": 0, "show_overbookings_and_unassigned_reservations": 1, "guest_check_out_invoice": "none", "undo_timer_account": "60", "theme": null, "default_language_account": "rs", "company_address": null, "send_email_in_case_of_overbooking": "1", "show_company_address_on_invoice": null, "send_email_for_new_reservations": "1", "send_offer_reminder_to_user": 1, "send_email_to_guests": null, "wubook_connected": -1, "bnovo_connected": 0, "channex_connected": 0, "last_activity": "2025-02-07 15:45:01", "phone_verified": 1, "email_verified": 0, "enable_2fa": 1, "2fa_type": "phone", "suspended": 0, "monthly_price": 0, "source": "web", "agency": 0, "agency_commission": 0, "registration_number": null, "user_without_email": 0, "id_resellers": null, "create_channex_group": 0, "id_channex_groups": "", "subscription_end_date": "2024-12-01", "type": "standard", "onboarded": 0, "is_dummy": 1, "payment_required": 1, "number_of_units": 5, "disable_credit_card": 0, "suspened": 0, "hear_about_us": "", "notes": null, "birth": null, "package": "no_selected", "allow_add_users": 1, "delete_reservation": 1, "onboarded_by_role": null, "onboarded_by_role_id": null, "is_deleted": 0, "date_deleted": null, "date_modified": "2025-02-07 15:45:01", "date_created": "2024-11-17 22:23:58", "pkey": "aef67742d092b285bb81e9ee65c17e0e884371fd", "properties": [ { "name": "Oasis", "id_properties": "6577" }, { "name": "Fares", "id_properties": "6579" }, { "name": "Sokratis", "id_properties": "7099" } ] } ``` ``` -------------------------------- ### Auth - Login API Source: https://documenter.getpostman.com/view/41568417/2sAYX5MNgD/index Authenticates a user via POST request to the login endpoint. Requires token, username, password, and remember flag. Returns user information and authorization key upon success. ```APIDOC ## POST /api/user/auth/login ### Description Authenticates a user by sending credentials and a token to the login endpoint. Upon successful authentication, it returns user details and an authorization key (`pkey`) for subsequent requests. ### Method POST ### Endpoint https://app.otasync.me/api/user/auth/login ### Parameters #### Request Body - **token** (string) - Required - A long token for authentication. - **username** (string) - Required - The username for login. - **password** (string) - Required - The password for login. - **remember** (number) - Optional - Indicates whether to remember the login session (e.g., 1 for true, 0 for false). ### Request Example ```json { "token": "your_auth_token", "username": "your_username", "password": "your_password", "remember": 1 } ``` ### Response #### Success Response (200) - **id_users** (string) - User ID. - **id_parent** (string) - Parent ID. - **status** (string) - User status. - **username** (string) - Username. - **pwd** (string) - Password hash (usually not returned). - **name** (string) - User's full name. - **email** (string) - User's email address. - **phone** (string) - User's phone number. - **address** (string) - User's address. - **city** (string) - User's city. - **zip** (string) - User's zip code. - **company** (string) - User's company name. - **country** (string) - User's country. - **properties** (array) - List of properties accessible by the user. - **userInf** (object) - Contains user information, including: - **pkey** (string) - Authorization key for other requests. #### Response Example ```json { "id_users": "123", "id_parent": "0", "status": "active", "username": "testuser", "pwd": "$2y$10$...", "name": "Test User", "email": "test@example.com", "phone": "123-456-7890", "address": "123 Main St", "city": "Anytown", "zip": "12345", "company": "OTASync", "country": "USA", "properties": [ { "id_property": "456", "name": "Beachfront Villa" } ], "userInf": { "pkey": "your_generated_pkey_for_api_access" } } ``` ``` -------------------------------- ### Logout User (POST) Source: https://documenter.getpostman.com/view/41568417/2sAYX5MNgD/index Logs out the current user. This endpoint requires a JSON payload containing the user's key. It returns a 204 No Content status upon successful logout and does not provide a response body. ```curl curl --location 'https://app.otasync.me/api/user/auth/logout' \ --header 'Content-Type: application/json' \ --data '{ "key": "0188a6b40ef1240b94b01825ba38fab4043adb0f" }' ``` -------------------------------- ### POST /api/user/auth/logout Source: https://documenter.getpostman.com/view/41568417/2sAYX5MNgD/index Logs out the current user by invalidating their session key. ```APIDOC ## POST /api/user/auth/logout ### Description Logs out the current user. This endpoint invalidates the provided session key. ### Method POST ### Endpoint https://app.otasync.me/api/user/auth/logout ### Parameters #### Request Body - **key** (string) - Required - The user's session key for logout. ### Request Example ```json { "key": "0188a6b40ef1240b94b01825ba38fab4043adb0f" } ``` ### Response #### Success Response (204) No Content. The request was successful, but there is no response body. #### Response Example No response body. ``` -------------------------------- ### User Logout API Endpoint Source: https://documenter.getpostman.com/view/41568417/2sAYX5MNgD/index This snippet describes the POST /api/user/auth/logout endpoint, used to log out a user. It requires a 'key' in the request body to identify and remove the user's active session from the database, rendering the key invalid for future use. ```http POST /api/user/auth/logout HTTP/1.1 Host: app.otasync.me Content-Type: application/json { "key": "aef67742d092b285bb81e9ee65c17e0e884371fd" } ``` -------------------------------- ### Edit One Signal Player ID (POST) Source: https://documenter.getpostman.com/view/41568417/2sAYX5MNgD/index Updates the One Signal player ID for a user. This endpoint requires a POST request with a JSON body containing the user's key and the new player ID. The response does not include a body. ```curl curl --location 'https://app.otasync.me/api/user/edit/one_signal' \ --data '{ "key": "97d3e00461337d64b0ef1463193451a355ad8c71", "player_id": "321" }' ``` -------------------------------- ### User Logout API Source: https://documenter.getpostman.com/view/41568417/2sAYX5MNgD/index This endpoint logs out a user by invalidating their session key. ```APIDOC ## POST /api/user/auth/logout ### Description Logs out a user and invalidates their session key, preventing further use. ### Method POST ### Endpoint https://app.otasync.me/api/user/auth/logout ### Parameters #### Request Body - **key** (string, required) - The authorization key (pkey) obtained during login to be invalidated. ``` -------------------------------- ### POST /api/user/edit/one_signal Source: https://documenter.getpostman.com/view/41568417/2sAYX5MNgD/index Updates the user's One Signal player ID associated with their account. ```APIDOC ## POST /api/user/edit/one_signal ### Description This endpoint allows the user to edit their One Signal player details, updating the associated player ID. ### Method POST ### Endpoint https://app.otasync.me/api/user/edit/one_signal ### Parameters #### Request Body - **key** (string) - Required - The user's One Signal API key. - **player_id** (string) - Required - The unique player ID to be updated. ### Request Example ```json { "key": "97d3e00461337d64b0ef1463193451a355ad8c71", "player_id": "321" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the update was successful. #### Response Example ```json { "message": "One Signal player ID updated successfully." } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.