Login

HTTP Request
POST https://domain.com/signin/1.0/json
Arguments
Parameter Type Required Description
login string Required User’s email
password string Required User’s password
device_type number Optional Device type
identifier string Optional Push notification identifier from Google or Apple
language string Optional Language code
timezone number Optional Number of seconds away from UTC
app_version string Optional Application version
device_model string Optional Device make and model
device_os string Optional Device operating system version

Specification for device properties are related to OneSignal API

                                                POST https://domain.com/signin/1.0/json
                                            

Successful login response

                                                [
  {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
      "company_id": 1,
      "db": "nebeus",
      "session_id": "95gdjkhksdhfjwehwlew",
      "uid": 154,
      "name": "Igor",
      "surname": "Igor",
      "partner_id": 169,
      "user_context": {
        "lang": "en_US",
        "tz": "Europe/Madrid",
        "uid": 154
      },
      "username": "Igor"
    }
  }
]
                                            

Unsuccessful login responsese

                                                {
  "id": null,
  "jsonrpc": "2.0",
  "result": {
    "status": "error",
    "message": "Login or password is incorrect"
  }
}
                                            

Logout

HTTP Request
POST http://domain.com/logout/1.0/json
                                                POST https://domain.com/logout/1.0/json
                                            

Successful logout response

                                                [
  {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
      "status": "success"
    }
  }
]
                                            

Reset password

HTTP Request
POST https://domain.com/reset_password/1.0/json
Arguments
Parameter Type Required Description
login string Required User’s email
                                                POST https://domain.com/reset_password/1.0/json
                                            

Successful response

                                                [
  {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
      "status": "success"
    }
  }
]
                                            

Unsuccessful response

                                                [
  {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
      "status": "error",
      "message": "..."
    }
  }
]
                                            

Signup

HTTP Request
POST http://nebeus.com/signup/1.0/json
Arguments
Parameter Type Required Description
login string Required User’s email
name string Required User’s name
surname string Required User’s surname
password string Required Password
confirm_password string Required Password confirmation
country number Required Country id
                                                POST https://domain.com/signup/1.0/json
                                            

Successful response

                                                [
  {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
      "status": "success"
    }
  }
]
                                            

Unsuccessful response

                                                [
  {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
      "status": "error",
      "errors": {
        "email": {
          "field": "email",
          "message": "..."
        },
        "country": {
          "field": "country",
          "message": "..."
        },
        "password": {
          "field": "password",
          "message": "..."
        }
      }
    }
  }
]
                                            

Get active countries

HTTP Request
POST http://domain.com/get_countries/1.0/json
                                                POST http://domain.com/get_countries/1.0/json
                                            

Example response

                                                [
  {
    "id": 1,
    "name": "Russia",
    "code": "RU",
    "phone_code": "+7"
  },
  {
    "id": 2,
    "name": "Spain",
    "code": "ES",
    "phone_code": "+34"
  }
]
                                            

Dashboard

HTTP Request
POST http://domain.com/partner/dashboard

Possible verification statuses for identity and residency address: not_verified, pending, verified, rejected.

                                                POST http://domain.com/partner/dashboard
                                            

Example response

                                                {
  "name": "User",
  "surname": "Anonymous",
  "city": "Barcelona",
  "country_name": "Spain",
  "country_code": "ES",
  "rating": 5,
  "credit_rank": 3,
  "verification": {
    "address": {
      "status": "verified",
      "points": 5
    },
    "identity": {
      "status": "verified",
      "points": 5
    },
    "phone": {
      "status": true,
      "points": 5
    }
  },
  "social_networks": [
    {
      "name": "Facebook Graph",
      "connected": false,
      "auth_link": "..."
    },
    {
      "name": "Google OAuth2",
      "connected": false,
      "auth_link": "..."
    },
    {
      "name": "LinkedIn",
      "connected": false,
      "auth_link": "..."
    },
    {
      "name": "PayPal",
      "connected": true,
      "auth_link": "..."
    }
  ],
  "default_currency": {
    "rate": 1,
    "name": "EUR"
  },
  "accounts": [
    {
      "acc_number": "1Bhrfsdljaflkiudsf",
      "currency": {
        "rate": 0.001163,
        "name": "BTC"
      },
      "sum": 0.001
    }
    {
      "acc_number": "1Bhrfsdljaflkiudsf",
      "currency": {
        "rate": 1,
        "name": "EUR"
      },
      "sum": 14.56
    }
  ],
  "transactions": [
    {
      "credit": 0,
      "currency": "BTC",
      "date": "2016-12-03 10:13:53",
      "debit": 0.001,
      "id": "dfb932fg",
      "partner": {
        "surname": "Transfer",
        "name": "Internal"
      },
      "type": "Disbursement of a loan"
    },
    {
      "credit": 0.001,
      "currency": "BTC",
      "date": "2016-12-03 14:30:56",
      "debit": 0.0,
      "id": "af32dffg",
      "partner": {
        "surname": "Anonymous",
        "name": "User",
        "id": 134,
        "country_code": "ES"
      },
      "type": "Disbursement of a loan"
    }
  ],
  "nearest_operations": [{
    "amount": 0,
    "date": "2016-12-08 10:13:45",
    "description": "Loan repayment",
    "id": "db8fa412d",
    "type": "credit"
  }],
  "reserved_money": {
    "credit": 10,
    "debit": 0.5,
    "currency_name": 'BTC'
  }
}
                                            

Get dashboard graphic details

HTTP Request
POST http://domain.com/dashboard/graphic

Returns data to create graphics. Includes debit/credit values for overall time, week, month, year and for the last days

                                                POST http://domain.com/dashboard/graphic
                                            

Example response

                                                {
  "all_time": {
    "credit": 0.232996,
    "debit": 0.225304
  },
  "days": {
    "2017-02-24": {
      "credit": 0,
      "debit": 0
    },
    "2017-02-25": {
      "credit": 0,
      "debit": 0
    },
    "2017-02-26": {
      "credit": 0,
      "debit": 0
    },
    "2017-02-27": {
      "credit": 0,
      "debit": 0
    },
    "2017-02-28": {
      "credit": 0.000101,
      "debit": 0
    },
    "2017-03-01": {
      "credit": 0,
      "debit": 0
    },
    "2017-03-02": {
      "credit": 0,
      "debit": 0
    },
    "2017-03-03": {
      "credit": 0,
      "debit": 0
    }
  },
  "month": {
    "credit": 0,
    "debit": 0
  },
  "week": {
    "credit": 0.000101,
    "debit": 0
  },
  "year": {
    "credit": 0.02455,
    "debit": 0.002163
  },
  "currency_name": 'BTC'
}
                                            

Get partner profile image

HTTP Request

Big image (150x150px)

GET http://domain.com/partner/${partner_id}/profile_image/big

Small image (64x64px)

GET http://domain.com/partner/${partner_id}/profile_image
                                                GET http://domain.com/partner/${partner_id}/profile_image/big
                                            

Get country flag

HTTP Request
GET http://domain.com/assets/svg/i_country-${country_code}.svg
                                                GET http://domain.com/assets/svg/i_country-${country_code}.svg
                                            

Submit support ticket

HTTP Request
POST http://domain.com/helpdesk/message
Arguments
Parameter Type Required Description
login string Required string with user’s email
name string Required string with user’s name
message string Required string with message
Returns

Dictionary with status of creating ticket in helpdesk and zendesk.

Contains fields:

Parameter Description Possible values
status status of creating process ‘success’ or 'error’
field field, which contains error *
message error message *
                                                POST http://domain.com/helpdesk/message
                                            

Successful ticket submission response

                                                [
  {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
      "status": "success"
    }
  }
]
                                            

Unsuccessful ticket submission response

                                                {
  "id": null,
  "jsonrpc": "2.0",
  "result": {
    "status": "error",
    "field": "email",
    "message": "Email should be specified"
  }
}
                                            

Get user notifications

HTTP Request
POST http://domain.com/user/notifications
                                                POST http://domain.com/user/notifications
                                            

Response example

                                                {
    "id": 325135889,
    "jsonrpc": "2.0",
    "result": {
        "messages": [
            {
                "date": "2016-08-11 17:43:46",
                "is_read": false,
                "msg_id": 733,
                "operation_id": "495a5420",
                "subject": " You have received a loan provision offer",
                "url": "/user/credits",
                "userpic": "/partner/1/profile_image"
            },
            {
                "date": "2016-08-11 10:57:40",
                "is_read": false,
                "msg_id": 722,
                "operation_id": "e804968c",
                "subject": " You have received the loan",
                "url": "/user/credits",
                "userpic": "/partner/1654/profile_image"
            },
            {
                "date": "2016-08-11 10:44:10",
                "is_read": false,
                "msg_id": 717,
                "operation_id": "ac438934",
                "subject": " You created loan request",
                "url": "/user/credits",
                "userpic": "/partner/1/profile_image"
            },
            {
                "date": "2016-08-11 10:43:23",
                "is_read": false,
                "msg_id": 716,
                "operation_id": "d49dfd54",
                "subject": " You have cancelled your loan request",
                "url": "/user/credits",
                "userpic": "/partner/1/profile_image"
            },
            {
                "date": "2016-07-28 13:39:42",
                "is_read": false,
                "msg_id": 388,
                "operation_id": "bcd15445",
                "subject": " The loan request publication term has expired",
                "url": "/user/credits",
                "userpic": "/partner/1/profile_image"
            }
        ],
        "new_count": 10
    }
}
                                            

Get user wallets

HTTP Request
POST /user/get_wallets_list/1.0/json
                                                POST /user/get_wallets_list/1.0/json
                                            

Response example

                                                {
  "id": null,
    "jsonrpc": "2.0",
    "result": [
    {
      "ac_currency_id": [181, "BTC"],
      "acc_number": "1BhrT6d3BLrS2kfT2BQMpJiiUHj8WyCbSw",
      "balance": 1.08274,
      "code": "1BhrT6d3BLrS2kfT2BQMpJiiUHj8WyCbSw",
      "create_date": "2016-06-10 10:28:50",
      "currency_id": [181, "BTC"],
      "display_name": "1BhrT6d3BLrS2kfT2BQMpJiiUHj8WyCbSw",
      "id": 338,
      "name": "/"
    },
    {
      "ac_currency_id": [1, "EUR"],
      "acc_number": "13412341324",
      "balance": 22,
      "code": "13412341324",
      "create_date": "2017-02-28 16:35:15",
      "currency_id": [1, "EUR"],
      "display_name": "13412341324",
      "id": 4067,
      "name": "/"
    }
  ]
}
                                            

Get wallet operations

Get partner operations for specified acccount and date range. If no date_from and date_to specified returns operations within last 30 days.

HTTP Request
POST /user/accounts/{account_id}/operations/
Arguments
Parameter Type Required Description
date_from string Optional Datetime moment including timezone, ex: 2016-03-11T10:14:00.190Z
date_to string Optional Datetime moment including timezone, ex: 2016-03-11T10:14:00.190Z

For fetching data for wallets containing slash symbols ’/’ please substitute slash for undescrore symbol ’_’. Ex., ‘W/1234’ should be requested as 'W_1234’

                                                POST /user/accounts/{account_id}/operations/
                                            

Response example

                                                {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
        "balance": "4.13",
        "currency_name": "BTC",
        "items": [
            {
                "amount": 0.11,
                "balance": 4.13,
                "date": "2017-03-09",
                "name": "Sell bitcoin",
                "num": "EUR/2017/03/17",
                "operation_ref": "ff525a15",
                "recipient": {
                    "name": "Money-4",
                    "surname": "Limited",
                    "id": 5067
                },
                "reference": "Sell bitcoin"
            }
        ],
        "topup": "0.11",
        "withdraw": "0.0"
    }
}
                                            

Get user cards

Get user saved cards

HTTP Request
POST /user/get_cards/1.0/json
                                                POST /user/get_cards/1.0/json
                                            

Response example

                                                {
    "id": null,
    "jsonrpc": "2.0",
    "result": [
        {
            "code": 4,
            "expiration_date": "2019-10-31 23:59:59",
            "pan_number": "42424242",
            "payment_system": "Visa"
        }
    ]
}
                                            

Get deposit methods

HTTP Request
POST http://domain.com/user/get_deposit_methods
Arguments
Parameter Type Required Description
currency string Optional Currency name
Arguments

Dictionary with list with data about available deposit methods.

Contains fields:

Parameter Description Possible values
id method id *
partner_id current partner id *
deposit_method method name *
bank_name bank name *
bank_country bank address: country *
bank_street bank address: street *
bank_city bank address: city *
bank_zip bank address: post index *
bic bank identification code *
bank_code bank code *
int_bank_account intermediary bank account number *
int_bank_swift intermediary bank SWIFT code *
int_bank intermediary bank name *
currency currency name *
currency_symbol currency symbol *
account_number account number *
account_owner account owner *
external_notes bank external notes *
help bank help information *
reference account reference *
minimum minimum sum in current currency *
                                                POST http://domain.com/user/get_deposit_methods
                                            

Successful response

                                                {
    "id": null,
    "jsonrpc": "2.0",
    "result":
    {
        "status": "success",
        "deposit_methods":
        [
            {
                "id": 15,
                "partner_id": 13,
                "deposit_method": "Swedbank NOK Normal",
                "bank_name": "Swedbank",
                "bank_country": "Finland",
                "bank_street": "Ilveskatu 5",
                "bank_city": "Helsinki",
                "bic": "SWED",
                "currency": "NOK",
                "currency_symbol": "kr",
                "int_bank_account": "FI33 0017 2247 0173 58",
                "int_bank_swift": "SWED",
                "int_bank": "Swedbank",
                "account_number": "FI33 0017 2247 0173 58",
                "account_owner": "Baltic Soft",
                "bank_code": "001",
                "bank_zip": false,
                "external_notes": "Swedbank External Notes",
                "help": "Swedbank Help",
                "reference": "nordea.no",
                "minimum": 50
            }
        ]
    }
}
                                            

Unsuccessful response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "status": "error",
        "message": "Managing company is not found"
    }
}
                                            

Create card to card transfer

Charges users card / wallet and creates order for sending money to recipient card If no source_id specified, fields card_number, cardholder_name, expiration_date and cvv should be specified. Likewise, if no recipient_id is specified, recipient_country_id, recipient_card_number, recipient_email, recipient_cardholder_name should be specified.

HTTP Request
POST https://domain.com/card2card/new/1.0/json
Arguments
Parameter Type Required Description
from_sum number Required sum to charge
to_sum number Required sum to send
to_sum_currency number Required sending sum currency id
source_id string Optional id of existing card or wallet
card_number string Optional payment card number
cardholder_name string Optional payment card cardholder name
expiration_date string Optional payment card expiration date
cvv string Optional payment card cvv
save_card_data boolean Optional should card details be saved to partner
recipient_id string Optional id of existing card to card transfer
recipient_country_id string Optional id of recipient country
recipient_card_number string Optional recipient card number
recipient_email string Optional recipient email address
recipient_phone string Optional recipient phone number
recipient_cardholder_name string Optional recipient cardholder name
save_recipient_details string Optional should recipient details be saved to partner
                                                POST https://domain.com/card2card/new/1.0/json
                                            

Search card to card transfers

Searches for current user previous card to card transfers by following fields: - cardholder name - card number - email

Returns array of card to card recipients or empty array.

HTTP Request
POST https://domain.com/card2card/search/1.0/json
Arguments
Parameter Type Required Description
query string Required cardholder name, card number or email
                                                POST https://domain.com/card2card/search/1.0/json
                                            

Successful search response

                                                [
  {
    "id": null,
    "jsonrpc": "2.0",
    "result": [
      {
        "cardholder_name": "Petr Ivanov",
        "card_number": "1234 **** **** 4321",
        "country_code": "ES",
        "email": "[email protected]"
      },
      {
        "cardholder_name": "Ivan Petrov",
        "card_number": "4444 **** **** 8888",
        "country_code": "RU",
        "email": "[email protected]"
      }
    ]
  }
]
                                            

Making requests

                                                Request to JSON API should be done using following signature.
                                            
                                                // Example using axios lib
import axios from 'axios';

// ....
const options = {
  id: null,
  jsonrpc: '2.0',
  method: 'call',
  params: {
    // method arguments
  }
}

axios.post('http://domain.com/signin/1.0/json', options)
// ...
// React Native Fetch API example
const params = {
  id: null,
  jsonrpc: '2.0',
  method: 'call',
  params: {
    // method arguments
  }
};

const options = {
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
  },
  method: 'POST',
  body: JSON.stringify(params),
}

fetch('http://domain.com/signin/1.0/json', options)
  .then(data => {
    // ...
  }, err => {
    // ...
  })
                                            

Get user transfers

Get user transfers

HTTP Request
POST /user/transfers
                                                POST /user/transfers
                                            

Response example

                                                {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
        "items": [
            {
                "age": "22 hours ago",
                "amount_in": 0.001,
                "amount_out": 0.001,
                "amount_out_base": 0,
                "confirmations": 0,
                "create_date": "2017-03-14 12:12:01",
                "currency_base": "EUR",
                "currency_in": "BTC",
                "currency_out": "BTC",
                "description": "test",
                "direction": "from",
                "operation_id": "d2e2300c32865fb01f9cb9b3281de0fa57e5e8ff4317594757add54ea2637da5",
                "recipient": {
                    "country_code": "_blank",
                    "email": false,
                    "name": "1PZVmyMPc42ZF6FpWejNuKNDpB6vufKG6T"
                },
                "refuse_reason": false,
                "seen": true,
                "sender": {
                    "country_code": "es",
                    "email": "[email protected]",
                    "id": 5992,
                    "name": "Igor"
                },
                "stage": {
                    "name": "Complete",
                    "num": 3
                }
            },
            {
                "age": "22 hours ago",
                "amount_in": 0.0001,
                "amount_out": 0.0001,
                "amount_out_base": 0,
                "confirmations": 0,
                "create_date": "2017-03-14 11:30:19",
                "currency_base": "EUR",
                "currency_in": "BTC",
                "currency_out": "BTC",
                "description": "test",
                "direction": "from",
                "operation_id": "ce735c8122f13b5091eef9b6f0837a8e920874ec4d0c8583f59ca143d0e53431",
                "recipient": {
                    "country_code": "_blank",
                    "email": false,
                    "name": "1PZVmyMPc42ZF6FpWejNuKNDpB6vufKG6T"
                },
                "refuse_reason": false,
                "seen": true,
                "sender": {
                    "country_code": "es",
                    "email": "[email protected]",
                    "id": 5992,
                    "name": "Igor"
                },
                "stage": {
                    "name": "Complete",
                    "num": 3
                }
            }
        ],
        "total": {
            "currency": "EUR",
            "from": 0,
            "to": 0
        }
    }
}
                                            

Buy and sell currency

Get available buy and sell limit

Get user available limit to buy and sell currency

                                                POST https://domain.com/btc/get_buy_limit/1.0/json
                                            

Response example

                                                {
  "id": null,
  "jsonrpc": "2.0",
  "result": {
    "status": "success",
    "limit": 300,
    "currency": "EUR"
  }
}
                                            

Get buying currency rates

Get buying currency rates. Returns similar response to getting normal currencies but returns actual rate to buy currency.

                                                POST https://domain.com/utils/get_buy_currencies/1.0/json
                                            

Response example

                                                {
    "id": null,
    "jsonrpc": "2.0",
    "result": [
        {
            "data-custom-class": "_btc",
            "name": "BTC",
            "rate": 0.000903674686878194,
            "symbol": "\u0243",
            "symbol-pos": "after",
            "value": "btc"
        },
        {
            "data-custom-class": "_eur",
            "name": "EUR",
            "rate": 1,
            "symbol": "\u20ac",
            "symbol-pos": "after",
            "value": "eur"
        }
    ]
}
                                            

Buy bitcoin

f user selects saved card or wallet on first request server sends code_id, time in milliseconds to enter pincode and timestamp to enter pin code received in email or as sms..

Request should have either payment_id, either details of a new card (card_number, cardholder_name, expiration_date, cvc).

If user received code to confirm transaction in new request there should be code and code_id arguments specified.

HTTP Request
POST /buy_currency/1.0/json
Arguments
Parameter Type Required Description
buy_amount string Required amount of BTC to buy
deposit_amount string Required amount of EUR to deposit
payment_id string Optional id of selected payment source in dropdown
account_id string Required id of account to deposit bought currency
save_card boolean Optional mark to save specified card details and its reference
code_id string code id reference to verify
code string code to verify and confirm transaction
cvc string CVV code for charging card
card_number string Card number to charge
cardholder_name string Cardholder name of charging card
expiration_date string Expiration date of charging card in format MM/YY, where MM - is month and YY is year
                                                POST https://domain.com/buy_currency/1.0/json
                                            

Code request response example

                                                {
  "jsonrpc": "2.0",
  "id": null,
  "result": {
    "status": "success",
    "timestamp": "2017-03-22 13:00:16",
    "method": "email",
    "code_id": 358,
    "time": 300000
  }
}
                                            

Successful charge response example

                                                {
  "jsonrpc": "2.0",
  "id": null,
  "result": {
    "status": "success"
  }
}
                                            

Unsuccessful charge response example

                                                {
  "jsonrpc": "2.0",
  "id": null,
  "result": {
    "status": "error",
    "message": "Something went wrong"
  }
}
                                            

Get selling currency rates

Get selling currency rates. Returns similar response to getting normal currencies but returns actual rate to sell currency.

                                                POST https://domain.com/utils/get_sell_currencies/1.0/json
                                            

Response example

                                                {
    "id": null,
    "jsonrpc": "2.0",
    "result": [
        {
            "data-custom-class": "_btc",
            "name": "BTC",
            "rate": 0.000903674686878194,
            "symbol": "\u0243",
            "symbol-pos": "after",
            "value": "btc"
        },
        {
            "data-custom-class": "_eur",
            "name": "EUR",
            "rate": 1,
            "symbol": "\u20ac",
            "symbol-pos": "after",
            "value": "eur"
        }
    ]
}
                                            

Sell bitcoin

On first request server sends code_id, time in milliseconds to enter pincode and timestamp to enter pin code received in email or as sms.

If user received code to confirm transaction in new request there should be code and code_id arguments specified.

HTTP Request
POST /sell_currency/1.0/json
Arguments
Parameter Type Required Description
sell_sum string Required amount of BTC to sell
buy_sum string Required amount of EUR to buy
debit_from string Required id of account to credit BTC from
deposit_to string Required id of account to deposit EUR to
code_id string code id reference to verify
code string code to verify and confirm transaction
                                                POST https://domain.com/sell_currency/1.0/json
                                            

Code request response example

                                                {
  "jsonrpc": "2.0",
  "id": null,
  "result": {
    "status": "success",
    "timestamp": "2017-03-22 13:00:16",
    "method": "email",
    "code_id": 358,
    "time": 300000
  }
}
                                            

Successful charge response example

                                                {
  "jsonrpc": "2.0",
  "id": null,
  "result": {
    "status": "success"
  }
}
                                            

Unsuccessful charge response example

                                                {
  "jsonrpc": "2.0",
  "id": null,
  "result": {
    "status": "error",
    "message": "Something went wrong"
  }
}
                                            

Get historical rate

Method to return historical rate for EUR to BTC for past 30 days. Returns array of dicts with datetime as keys and rate as values.

HTTP Request
POST /get_historical_rate
                                                POST https://domain.com/get_historical_rate
                                            

Response example

                                                {
  "jsonrpc": "2.0",
  "id": null,
  "result": [
    {"2017-03-24 21:16:29": 0.001133},
  ]
}
                                            
                                                We suppose to store rate every minute, but not to overweight db we only keep changed values in time.
                                            

Get or create session

HTTP Request
POST http://domain.com/im_chat/api/get_or_create_session
Arguments
Parameter Type Required Description
user_to number Required ID of user
doc_id string Optional ID of document
doc_model string Optional document’s model
Returns

Dictionary with data about session.

Contains fields:

Parameter Description Possible values
uuid session uuid *
create_date date of session creating *
users list of users *
groups list of groups *
docs list of documents *
state state of session ‘open’, 'folded’ or 'closed’
status status of chat 'active’, 'favorite’ or 'archive’
with_documents attribute of chat with document true or false
is_group attribute of group session true or false
is_read attribute of read chat true or false
                                                POST https://domain.com/reset_password/1.0/json
                                            

Successful response

                                                [
  {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
      "status": "success"
    }
  }
]
                                            

Unsuccessful response

                                                [
  {
    "id": null,
    "jsonrpc": "2.0",
    "result": {
      "status": "error",
      "message": "..."
    }
  }
]
                                            

Get or create session with group

HTTP Request
POST http://domain.com/im_chat/api/get_or_create_session_group
Arguments
Parameter Type Required Description
group number Required ID of group
doc_id string Optional ID of document
doc_model string Optional document’s model
Returns

Dictionary with data about session.

Contains fields:

Parameter Description Possible values
uuid session uuid *
create_date date of session creating *
users list of users *
groups list of groups *
docs list of documents *
state state of session 'open’, 'folded’ or 'closed’
status status of chat 'active’, 'favorite’ or 'archive’
with_documents attribute of chat with document true or false
is_group attribute of group session true or false
is_read attribute of read chat true or false
                                                POST http://domain.com/im_chat/api/get_or_create_session_group
                                            

Example response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "create_date": "2017-02-02 07:56:00",
        "uuid": "91e03d34-1929-4a02-9486-4c3e708686b3",
        "with_documents": true,
        "status": "active",
        "state": "open",
        "is_group": true,
        "is_read": true,
        "groups":
        [
            {
                "id": 3,
                "name": "News"
            }
        ],
        "docs:":
        [
            {
                "doc_model": "res.partner",
                "doc_id": 25,
                "id": 9
            }
        ],
        "users":
        [
            {
                "im_status": "away",
                "id": 5,
                "name": "Lucid Lynx",
                "partner_id":
                (
                    6,
                    "Lucid Lynx"
                ),
                "last_message":
                {
                    "type": "message",
                    "message": "222",
                    "create_date": "2017-04-10 07:46:21",
                    "id": 191
                }
            },
            {
                "im_status": "away",
                "id": 6,
                "name": "Oneiric Ocelot",
                "partner_id":
                (
                    7,
                    "Oneiric Ocelot"
                ),
                "last_message":
                {
                    "type": "message",
                    "message": "444",
                    "create_date": "2017-04-10 07:50:40",
                    "id": 201
                }
            }
        ]
    }
}
                                            

Get sessions

HTTP Request
POST http://domain.com/im_chat/api/get_sessions
Arguments
Parameter Type Required Description
user_to number Optional ID of user
doc_id string Optional ID of document
doc_model string Optional document’s model
state string Optional state of session
Returns

List with dictionaries with data about sessions.

Contains fields:

Parameter Description Possible values
uuid session uuid *
create_date date of session creating *
users list of users *
groups list of groups *
docs list of documents *
state state of session 'open’, 'folded’ or 'closed’
status status of chat 'active’, 'favorite’ or 'archive’
with_documents attribute of chat with document true or false
is_group attribute of group session true or false
is_read attribute of read chat true or false
                                                POST http://domain.com/im_chat/api/get_sessions
                                            

Example response

                                                [
    {
        "create_date": "2017-02-02 07:56:00",
        "uuid": "91e03d34-1929-4a02-9486-4c3e708686b3",
        "with_documents": true,
        "status": "active",
        "state": "open",
        "is_group": false,
        "is_read": true,
        "groups": [],
        "docs:":
        [
            {
                "doc_model": "res.partner",
                "doc_id": 25,
                "id": 9
            }
        ],
        "users":
        [
            {
                "im_status": "away",
                "id": 5,
                "name": "Lucid Lynx",
                "partner_id":
                (
                    6,
                    "Lucid Lynx"
                ),
                "last_message":
                {
                    "type": "message",
                    "message": "222",
                    "create_date": "2017-04-10 07:46:21",
                    "id": 191
                }
            },
            {
                "im_status": "away",
                "id": 6,
                "name": "Oneiric Ocelot",
                "partner_id":
                (
                    7,
                    "Oneiric Ocelot"
                ),
                "last_message":
                {
                    "type": "message",
                    "message": "444",
                    "create_date": "2017-04-10 07:50:40",
                    "id": 201
                }
            }
        ]
    }
]
                                            

Get sessions with group

HTTP Request
POST http://domain.com/im_chat/api/get_sessions_group
Arguments
Parameter Type Required Description
group number Optional ID of group
doc_id string Optional ID of document
doc_model string Optional document’s model
state string Optional state of session
Returns

List with dictionaries with data about sessions.

Contains fields:

Parameter Description Possible values
uuid session uuid *
create_date date of session creating *
users list of users *
groups list of groups *
docs list of documents *
state state of session 'open’, 'folded’ or 'closed’
status status of chat 'active’, 'favorite’ or 'archive’
with_documents attribute of chat with document true or false
is_group attribute of group session true or false
is_read attribute of read chat true or false
                                                POST http://domain.com/im_chat/api/get_sessions_group
                                            

Example response

                                                [
    {
        "create_date": "2017-02-02 07:56:00",
        "uuid": "91e03d34-1929-4a02-9486-4c3e708686b3",
        "with_documents": true,
        "status": "active",
        "state": "open",
        "is_group": true,
        "is_read": true,
        "groups":
        [
            {
                "id": 3,
                "name": "News"
            }
        ],
        "docs:":
        [
            {
                "doc_model": "res.partner",
                "doc_id": 25,
                "id": 9
            }
        ],
        "users":
        [
            {
                "im_status": "away",
                "id": 5,
                "name": "Lucid Lynx",
                "partner_id":
                (
                    6,
                    "Lucid Lynx"
                ),
                "last_message":
                {
                    "type": "message",
                    "message": "222",
                    "create_date": "2017-04-10 07:46:21",
                    "id": 191
                }
            },
            {
                "im_status": "away",
                "id": 6,
                "name": "Oneiric Ocelot",
                "partner_id":
                (
                    7,
                    "Oneiric Ocelot"
                ),
                "last_message":
                {
                    "type": "message",
                    "message": "444",
                    "create_date": "2017-04-10 07:50:40",
                    "id": 201
                }
            }
        ]
    }
]
                                            

Get all users

HTTP Request
POST http://domain.com/im_chat/api/get_sessions_group

Get all users without users from address book of current user

Returns

List with dictionaries with data about users.

Contains fields:

Parameter Description Possible values
im_status chat status 'online’, 'offline’ or 'away’
id user id *
name user name *
                                                POST http://domain.com/im_chat/api/user_chat_ab/get_all_users
                                            

Example response

                                                [
    {
        "im_status": "offline",
        "id": 5,
        "name": "odoo"
    },
    {
        "im_status": "offline",
        "id": 239,
        "name": "Ivan"
    },
    {
        "im_status": "offline",
        "id": 330,
        "name": "Test1"
    }
]
                                            

Get users from book

HTTP Request
POST http://domain.com/im_chat/api/user_chat_ab/get_users_from_book

Get all users from address book of current user

Returns

List with dictionaries with data about users.

Contains fields:

Parameter Description Possible values
im_status chat status 'online’, 'offline’ or 'away’
id user id *
name user name *
                                                POST http://domain.com/im_chat/api/user_chat_ab/get_users_from_book
                                            

Example response

                                                [
    {
        "im_status": "offline",
        "id": 5,
        "name": "odoo"
    }
]
                                            

Add users in book

HTTP Request
POST http://domain.com/im_chat/api/user_chat_ab/add_users

Add user in address book of current user

Arguments
Parameter Type Required Description
user_ids list of user ids Required User IDs
Returns

Dictionary with status of operation.

Contains fields:

Parameter Description Possible values
status status of operation 'success’ or 'error’
message error message *
                                                POST http://domain.com/im_chat/api/user_chat_ab/add_users
                                            

Successful response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "status": "success"
    }
}
                                            

Unsuccessful response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "status": "error",
        "message": "user_ids is not list"
    }
}
                                            

Remove users from book

HTTP Request
POST http://domain.com/im_chat/api/user_chat_ab/remove_users

Remove user from address book of current user

Arguments
Parameter Type Required Description
user_ids list of user ids Required User IDs
Returns

Dictionary with status of operation.

Contains fields:

Parameter Description Possible values
status status of operation 'success’ or 'error’
message error message *
                                                POST http://domain.com/im_chat/api/user_chat_ab/remove_users
                                            

Successful response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "status": "success"
    }
}
                                            

Unsuccessful response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "status": "error",
        "message": "user_ids is not list"
    }
}
                                            

Add partner in book

HTTP Request
POST http://domain.com/im_chat/api/user_chat_ab/add_partner

Add partner in address book of current partner

Arguments
Parameter Type Required Description
parent_partner_id number Required ID of owner of address book
child_partner_id number Required Added partner ID in book
Returns

Dictionary with status of operation.

Contains fields:

Parameter Description Possible values
status status of operation 'success’ or 'error’
message error message *
                                                POST http://domain.com/im_chat/api/user_chat_ab/add_partner
                                            

Successful response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "status": "success"
    }
}
                                            

Unsuccessful response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "status": "error",
        "message": "input parameters are not valid"
    }
}
                                            

Post message

HTTP Request
POST http://domain.com/im_chat/post

Post message in chat

Arguments
Parameter Type Required Description
uuid string Required Session UUID
message_type string Required Type of message
message_content string Required Content of message
Returns

ID of message.

Parameter Description Possible values
message_id ID of posted message *
                                                POST http://domain.com/im_chat/post
                                            

Chat initialization

HTTP Request
POST http://domain.com/im_chat/api/init

Initialize chat for current user and returns his contact list. Method supports filtration of contact list by name and quantity of output names.

Arguments
Parameter Type Required Description
name string Required search name of user field
limit number Optional quantity of output names in contact list
Returns

List with dictionaries with data about users in contact list.

Contains fields:

Parameter Description Possible values
last_message last message data *
im_status status of chat member 'online’, 'offline’ or 'away’
id user’s ID *
name name of user *
email user’s email *
partner_id partner’s ID *
                                                POST http://domain.com/im_chat/api/init
                                            

Successful response

                                                [
    {
        "last_message":
        {
            "type": "message",
            "create_date": "2017-03-30 09:15:07",
            "id": 118
        },
        "im_status": "away",
        "id": 8,
        "name": "Russian Support",
        "email": "[email protected]",
        "partner_id": 9
    }
]
                                            

Unsuccessful response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "status": "error",
        "message": "input parameters are not valid"
    }
}
                                            

Get history of messages

HTTP Request
POST http://domain.com/im_chat/api/history

Method that is used for getting history of messages in current session. Method supports filtration of messages in output list by ID of last message and quantity of messages in output list. Method also changes is_read parameter of current session for current user in True value.

Arguments
Parameter Type Required Description
uuid string Required session UUID
last_ID number Optional ID of last message
limit number Optional quantity of messages in output list
Returns

List with dictionaries with data about messages

Contains fields:

Parameter Description Possible values
create_date date of message creating *
to_id data about session *
message text of message *
type type of message 'message’, 'money4_chat_attach_msg’ or 'typing’
id message ID *
from_id data about sender (user data) *
from_partner_id data about sender (partner data) *
                                                POST http://domain.com/im_chat/api/history
                                            

Example response

                                                [
    {
        "create_date": "2017-03-30 09:15:07",
        "to_id":
        (
          15,
          "37474642-60c7-4315-8575-0497ad23ac12"
        ),
        "message": "888",
        "type": "message",
        "id": 118,
        "from_id":
        (
            8,
            "Russian Support"
        ),
        "from_partner_id":
        (
            9,
            "Russian Support"
        )
    },
    {
        "create_date": "2017-03-30 09:14:47",
        "to_id":
        (
            15,
            "37474642-60c7-4315-8575-0497ad23ac12"
        ),
        "message": "999",
        "type": "message",
        "id": 113,
        "from_id":
        (
            5,
            "Lucid Lynx"
        ),
        "from_partner_id":
        (
            6,
            "Lucid Lynx"
        )
    },
    {
        "create_date": "2017-03-30 09:14:45",
        "to_id":
        (
            15,
            "37474642-60c7-4315-8575-0497ad23ac12"
        ),
        "message": "555",
        "type": "message",
        "id": 108,
        "from_id":
        (
            5,
            "Lucid Lynx"
        ),
        "from_partner_id":
        (
            6,
            "Lucid Lynx"
        )
    },
    {
        "create_date": "2017-03-29 10:50:10",
        "to_id":
        (
            15,
            "37474642-60c7-4315-8575-0497ad23ac12"
        ),
        "message": "111",
        "type": "message",
        "id": 98,
        "from_id":
        (
            5,
            "Lucid Lynx"
        ),
        "from_partner_id":
        (
            6,
            "Lucid Lynx"
        )
    }
]
                                            

Change session status

HTTP Request
POST http://domain.com/im_chat/api/change_session_status

Method that is used for changing status of current user’s session.

Arguments
Parameter Type Required Description
uuid string Optional session UUID
new_status string Optional new status of session
Returns

Dictionary with status of operation and optional error message.

Contains fields:

Parameter Description Possible values
status status of operation 'success’ or 'error’
field field, which contains error *
message error message *
                                                POST http://domain.com/im_chat/api/change_session_status
                                            

Successful response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "status": "success"
    }
}
                                            

Unsuccessful response

                                                {
    "jsonrpc": "2.0",
    "id": null,
    "result":
    {
        "status": "error",
        "field": "uuid",
        "message": "Session does not exist"
    }
}