Partner
Another company the active company is in relation with. The relation with a partner is defined using a set of rights.
Read only fields are computed by AirVantage and can only be seen on response fragments sent by find, edit requests.
Field | Description | Read Only | Type |
---|---|---|---|
uid | Partner's unique identifier. | true | uid |
name | Partner's name. | false | string |
profile | The assigned profile to this partner. In other words, a user from the partner company will be linked with this profile. | false |
This is a complete representation of a Partner. This fragment can be used for edit request. Please refer to the fields section to know which fields can be modified.
{ "uid": "", "name": "", "profile": { "uid": "", "name": "" } }
API Methods
Find
/api/v1/partners
Returns a paginated list of partners with their complete details.
It is possible to restrain the result list using criteria parameters.
The fields parameter has to be defined in order to specify the attributes of the partner which will be returned.
If fields parameter is missing, only the following attributes of the partner are returned : uid, name.
More information about paging, filtering, and sorting here
Request
GET https://na.airvantage.net/api/v1/partners?fields=uid,name,profile&name=One
Response
200 OK
HTTP/1.1 200 OK Content-Type: application/json ... { "items": [ { "name": "Partner One", "uid": "7fe11df637264cd2ab6a2cddde2f817d", "profile": { "uid": "5a3e78ca0ea64d6a9bdaef5966e8b374", "name": "Basic Partner" } }], "count": 1, "size": 1, "offset": 0 }
Name | Description | Use | Default | Type | Operand |
---|---|---|---|---|---|
name | Find partners of which the name is LIKE the specified string | optional | null | string | like |
profile | Find partners linked to a specific profile | optional | null | uid string | = |
company | Set the context company. | optional | caller's company | uid | = |
HTTP Method | GET |
Requires Authentication | Yes |
Rate Limited | Yes |
Headers | None |
Permissions | accountNetwork.partners.view |
Order by | name |
Fields | uid, name, picture, profile |
Details
/api/v1/partners/{uid}
Returns detailed information about the specified partner.
Request
GET https://na.airvantage.net/api/v1/partners/7fe11df637264cd2ab6a2cddde2f817d
Response
200 OK
HTTP/1.1 200 OK Content-Type: application/json ... { "name": "Partner One", "uid": "7fe11df637264cd2ab6a2cddde2f817d", "profile": { "uid": "5a3e78ca0ea64d6a9bdaef5966e8b374", "name": "Basic Partner" }
Name | Description | Use | Default | Type |
---|---|---|---|---|
company | Set the context company. | optional | caller's company | uid |
Name | Description |
---|---|
partner.unknown | The specified uid does not match with any partner. |
HTTP Method | GET |
Requires Authentication | Yes |
Rate Limited | Yes |
Headers | None |
Permissions | accountNetwork.partners.view |
Edit
/api/v1/partners/{uid}
Edits partner details. It is only possible to assign another profile to the partner.
Request
PUT https://na.airvantage.net/api/v1/partners/7fe11df637264cd2ab6a2cddde2f817d ... // With the following content { "profile" : { "uid" : "5a3e78ca0ea64d6a9bdaef5966e8b374" } }
Response
200 OK
HTTP/1.1 200 OK Content-Type: application/json ... { "name": "Partner One", "uid": "7fe11df637264cd2ab6a2cddde2f817d", "profile": { "uid": "5a3e78ca0ea64d6a9bdaef5966e8b374", "name": "Basic Partner" }
Name | Description | Use | Default | Type |
---|---|---|---|---|
company | Set the context company. | optional | caller's company | uid |
Name | Description |
---|---|
partner.unknown | The specified uid does not match with any partner. |
profile.unknown | Provided profile does not exist. |
HTTP Method | PUT |
Requires Authentication | Yes |
Rate Limited | Yes |
Headers | None |
Permissions | administrator |
Request
/api/v1/operations/partners/request
Sends a partnership request to another company.
Request
POST https://na.airvantage.net/api/v1/operations/partners/request Content-Type:application/json ... // With the following content { "partner" : "01bf08b75e124e3d836443b323a3f190", "message" : "Let's work together!!!", "profile" : "ee81d84aec5b4d4397ead51b823b76a7" }
Response
200 OK
HTTP/1.1 200 OK Content-Type: application/json ... { "operation": "7fe11df637264cd2ab6a2cddde2f817d" }
Send a transfert request
{ "notify" : true|false, "callback" : "callback_url", "partner" : "partner_uid", "message" : "xyz", "profile" : "profile_uid" }
Field | Description | Use | Default | Type |
---|---|---|---|---|
notify | Send an email notification to the user calling this method when the operation finishes. | optional | false | boolean |
callback | The url that will be called when the operation state changes. The url has the following pattern : http(s)://(user:password@)www.yourhost.com/your_rest_service | optional | string | |
partner | The uid of the company with which you want to be a partner | required | uid | |
message | Message to explain the purpose of the transfer | optional | string | |
profile | The uid of the profile which will be used by users of the partner in your company. | optional | uid |
Accept a partnership request
The following API has to be used to accept a partnership: Accept. When you accept a partnership, you can specify a profile which will be used by users of the partner in your company.
{ "message" : "xxx", "data" : { "profile" : "xxx" } }
Field | Description | Use | Default | Type |
---|---|---|---|---|
message | An acceptance message to be returned to the request sender. | optional | string | |
data.profile | The profile which will be used by users of the partner in your company. | optional | string |
Name | Description | Use | Default | Type |
---|---|---|---|---|
company | Set the context company. | optional | caller's company | uid |
Name | Description |
---|---|
company.unknown | The specified uid does not match with any existing company. |
company.missing | A company must be provided. |
profile.unknown | Provided profile does not exist. |
profile.missing | A profile must be provided. |
partner.exists | Provided company is already a partner. |
HTTP Method | POST |
Requires Authentication | Yes |
Rate Limited | Yes |
Headers | Content-type: application/json |
Permissions | accountNetwork.partners.add |