Profiles

Introduction

Using this API object, you can work with user profiles, receive and update information, work with additional fields and search the database.

This object requires the authorization of a user with "profile" rights in grants.

Calling methods

To invoke methods, use the Users object. All methods are located within this URL:

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

Available methods of the Users object

Method Usage For
Users.get_user_data Get User Profile Data API/SDK
Users.find_user Find User API/SDK
Users.get_user_by_id Get User by UID Get User by UID

Users.get_user_data

This method is used to retrieve the profile data of the current authorized user. Data retrieval takes place using _accesstoken. Attention! To return information about the profile of an authorized user, when you receive an authorization link, you must send the profile parameter to grants

Method URL

https://cp.ocugine.pro/api/users/get_user_data/

Submitted data

Name Type Usage
app_id double Application ID
app_key string Application Client Key
access_token string Access Token
lang (not required) string Request Language

Response data

Name Type Usage
complete bool Operation Status
message string Error message
data array/object Data object

Data Object

Name Type Usage
base_data object Base profile data
advanced_data object Advanced profile data
group_data object User group data

Base Data

Name Type Usage
uid double Profile UID
first_name string First Name
last_name string Last Name
avatar string User Avatar URL
email string User Email
profile_data object Additional Profile Data
profile_type int Profile Type

Response Example

{
  "complete": true,
  "message": null,
  "data": {
    "base_data": {
      "uid": "17",
      "first_name": "",
      "last_name": "",
      "avatar": "",
      "email": "[email protected]",
      "profile_data": false,
      "profile_type": false
    },
    "advanced_data": {},
    "group_data": {}
  }
}

Users.find_user

This method is used to search for a user by first or last name. The server will display a list of users for your request, taking into account that the user has installed the application and has given him access to his profile.

Method URL

https://cp.ocugine.pro/api/users/find_user/

Submitted data

Name Type Usage
app_id double Application ID
app_key string Application Client Key
search (not required) string Search Request
page (not required) int Page number (20 per page)
lang (not required) string Request Language

Response data

Name Type Usage
complete bool Operation Status
message string Error message
data array/object Data object

Data Object

Name Type Usage
list array Users List with Base Data

Base Data

Name Type Usage
uid double Profile UID
first_name string First Name
last_name string Last Name
avatar string User Avatar URL
email string User Email
profile_data object Additional Profile Data
profile_type int Profile Type

Response Example

{
  "complete": true,
  "message": null,
  "data": {
    "list": [
      {
        "uid": "18",
        "first_name": "Ilya",
        "last_name": "Rastorguev",
        "avatar": "",
        "email": "[email protected]",
        "profile_data": false,
        "profile_type": "1"
      },
      {
        "uid": "17",
        "first_name": "Ocugine",
        "last_name": "Services",
        "avatar": "",
        "email": "[email protected]",
        "profile_data": false,
        "profile_type": "1"
      }
    ]
  }
}

Users.get_user_by_id

This method is used to retrieve user data for an application by its Ocugine Profile ID. The server will display information about the user only if this user has authorized the use of profile data in the application and installed it.

Method URL

https://cp.ocugine.pro/api/users/get_user_by_id/

Submitted data

Name Type Usage
app_id double Application ID
app_key string Application Client Key
profile_uid double Ocugine Profile UID
lang (not required) string Request Language

Response data

Name Type Usage
complete bool Operation Status
message string Error message
data array/object Data object

Data Object

Name Type Usage
base_data object Base profile data
advanced_data object Advanced profile data
group_data object User group data