Utils Object

Introduction

This object is very useful if you want to use the internal API methods to implement your project. It will help you determine the type of agent, verify project keys, etc.

You can use utils object by following API url:

https://cp.ocugine.pro/api/utils/

Available Methods

Use the following methods to get access for Ocugine API Utils.

Object / Method URL Description
Utils.get_ua https://cp.ocugine.pro/api/utils/get_ua/ Use this method to get current User Agent. This methods works for every user - even if it is not authorized.
Utils.get_ip https://cp.ocugine.pro/api/utils/get_ip/ Use this method to get current User IP Address. This methods works for every user - even if it is not authorized.
Utils.get_device https://cp.ocugine.pro/api/utils/get_device/ Use this method to get current User Device Type. This methods works for every user - even if it is not authorized.
Utils.check_keys https://cp.ocugine.pro/api/utils/check_keys/ Use this method to verify your application ID and Key.

User Agent

You can get the user agent following this API url:

https://cp.ocugine.pro/api/utils/get_ua/

This methods works for every user - even if it is not authorized.

Response Example

{
    "complete": true,
    "message": "",
    "data": {
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.71"
    }
}

User IP

You can get the user ip following this API url:

https://cp.ocugine.pro/api/utils/get_ip/

This methods works for every user - even if it is not authorized.

Response Example

{
    "complete": true,
    "message": "",
    "data": {
        "ip": "46.146.221.225"
    }
}

User Device

You can get the user device type following this API url:

https://cp.ocugine.pro/api/utils/get_device/

This method works for every user - even if it is not authorized.

Response Example

{
    "complete": true,
    "message": "",
    "data": {
        "user_device": "PC"
    }
}

Check Keys

You can verify your application ID and Client Key using this method:

https://cp.ocugine.pro/api/utils/check_keys/

The request parameters should include:

Name Type Desc
app_id double Your Application ID. You can see your Application ID here.
app_key string Your Application Client Key. You can see your Client Key here.

Request Data Example

{
    "app_id": 1,
    "app_key": "example_key"
}

Response Example

{
    "complete": true,
    "message": "",
    "data": []
}

When your application has wrong key / id - this method returns complete = false status. For verified Application ID and Key request returns complete = true.