Relations
On this page:
THE RELATION OBJECT |
|
GET[base]/relations |
|
GET[base]/relations/{relationId} |
|
POST[base]/relations |
|
PUT[base]/relations/{relationId} |
|
DELETE[base]/relations/{relationId} |
The Relation object
This object provides the following data about a relation between two IB users:
- relationId string
The relation identifier.
- childUserId string
The identifier of a child user.
- childUser object
The data of a child user. For fields description, refer to The User object.
- parentUserId string
The identifier of a parent user.
- parentUser object
The data of a parent user. For fields description, refer to The User object.
- createTime string
The date and time when the object has been created.
- updateTime string
The date and time when the object has been last updated.
{
"relationId": "6006dda272f002519c3eb505",
"childUserId": "6006dda272f002519c3eb506",
"childUser": {
"userId": "6006dda272f002519c3eb507",
"profileId": "6006dda272f002519c3eb508",
"groupId": "6006dda272f002519c3eb509",
"master": false,
"masterMaxLevel": 100,
"masterRatio": "1.000000000000000000",
"ratio": "1.000000000000000000",
"tag": "12345",
"createTime": "2021-01-01T00:00:00+00:00",
"updateTime": "2021-01-01T00:00:00+00:00",
"uuid": null
},
"parentUserId": "6006dda272f002519c3eb510",
"parentUser": {
"userId": "6006dda272f002519c3eb511",
"profileId": "6006dda272f002519c3eb512",
"groupId": "6006dda272f002519c3eb513",
"master": true,
"masterMaxLevel": 100,
"masterRatio": "1.000000000000000000",
"ratio": "1.000000000000000000",
"tag": "12345",
"createTime": "2021-01-01T00:00:00+00:00",
"updateTime": "2021-01-01T00:00:00+00:00",
"uuid": null
},
"createTime": "2021-01-01T00:00:00+00:00",
"updateTime": "2021-01-01T00:00:00+00:00"
}
Get a relations list
Use this method to obtain a list of user relations.
To obtain detailed information about a specified relation, use a separate method to get relation details.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
This method supports pagination, sorting, filtering, and query. For details on applying the parameters, refer to the Query parameters section. Possible parameters for filtering, sorting, and query are listed below. For values description, refer to the Relation object.
Possible values for the filter
parameter:
childUserId
parentUserId
Possible values for the sort_by
parameter:
paymentAmount
createTime
paymentVolume
relationId
updateTime
Possible values for the query
parameter:
profile
— profile informationcontacts
— contact detailsplatform
— trading platform informationmetrics
— information about clients and reward paymentsgroup
— partnership program informationaccounts
— accounts informationwallets
— wallets informationmethod
— payment method information
GET[base]/relations
curl --location -g --request GET 'https://your.base-url.here/relations?limit=10&offset=0&sort_by=createTime&sort_order=desc&filter[childUserId]=6006dda272f002519c3eb505&filter[parentUserId]=6006dda272f002519c3eb505&filter[uuid]=9&query[group]=1&query[resources]=1&query[accounts]=1&query[metrics]=1&query[wallets]=1&query[platform]=1&query[profile]=1&query[contacts]=1&query[method]=1' \
--header 'Authorization: Bearer <token>'
Response
Body:
In case of success, the response body contains an array of Relation objects providing information about the available relations that correspond to the query parameters specified in the request.
Additionally, the response body may contain the following information, if any of these were specified in the query parameters of the request:
the Profile object
an array of Contact objects
the Platform object
an array of
metrics
providing information about clients and reward paymentsthe IB type object
the Account object
the Wallet object
Get relation details
Use this method to obtain detailed information about a specified relation.
To obtain a list of relations, use a separate method to get a list of relations.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- relationId required
The relation identifier.
Query parameters:
This method supports query. For details on applying the parameters, refer to the Query parameters section.
Possible values for the query
parameter:
profile
— profile informationcontacts
— contact detailsplatform
— trading platform informationmetrics
— information about clients and reward paymentsgroup
— partnership program informationaccounts
— accounts informationwallets
— wallets informationmethod
— payment method information
GET[base]/relations/{relationId}
curl --location -g --request GET 'https://your.base-url.here/relations/60ba407d15951453e60e49f8?query[group]=1&query[resources]=1&query[accounts]=1&query[metrics]=1&query[wallets]=1&query[platform]=1&query[profile]=1&query[contacts]=1&query[method]=1' \
--header 'Authorization: Bearer <token>'
Response
Body:
In case of success, the response body contains a Relation object providing information about the specified relation.
Additionally, the response body may contain the following information, if any of these were specified in the query parameters of the request:
the Profile object
an array of Contact objects
the Platform object
an array of
metrics
providing information about clients and reward paymentsthe IB type object
the Account object
the Wallet object
Add a new relation
Use this method to add a new relation.
Request
Header parameters:
Authorization: Bearer <token>
Content-Type: application/json
Body:
- childUserId string required
The identifier of a child user.
- parentUserId string required
The identifier of a parent user.
- uuid string
The universally unique identifier of a relation.
The string value length can’t exceed 255 characters.
POST[base]/relations
curl --location -g --request POST 'https://your.base-url.here/relations' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"childUserId": "6006dda272f002519c3eb505",
"parentUserId": "6006dda272f002519c3eb505",
"uuid": null
}'
Response
Body:
In case of success, the response body contains a Relation object providing information about the newly created relation.
Update a relation
Use this method to update a specified relation.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <token>
Content-Type: application/json
Path parameters:
- relationId required
The relation identifier.
Body:
Values of the following fields can be updated:
- uuid string
The universally unique identifier of a relation.
The string value length can’t exceed 255 characters.
PUT[base]/relations/{relationId}
curl --location -g --request PUT 'https://your.base-url.here/relations/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"uuid": null
}'
Body:
In case of success, the response body contains a Relation object providing information about the updated relation.
Delete a relation
Use this method to delete a specified relation.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- relationId required
The relation identifier.
DELETE[base]/relations/{relationId}
curl --location --request DELETE 'https://your.base-url.here/relations/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'
Response
Body:
In case of success, no response body is returned.