Back to Apitable

.ContactsRoleApiApi

packages/api-client/ContactsRoleApiApi.md

1.13.0-beta.112.7 KB
Original Source

.ContactsRoleApiApi

All URIs are relative to http://backend/api/v1

MethodHTTP requestDescription
addRoleMembersPOST /org/roles/{roleId}/membersadd role members
createRolePOST /org/rolescreate new role
deleteRole1DELETE /org/roles/{roleId}delete role
getRoleMembersGET /org/roles/{roleId}/membersquery role members
getRolesGET /org/rolesquery roles
initRolesPOST /org/roles/initcreate init role
removeRoleMembersDELETE /org/roles/{roleId}/membersremove role members
updateRolePATCH /org/roles/{roleId}update role information

addRoleMembers

ResponseDataVoid addRoleMembers(addRoleMemberRo, )

add role members

Example

typescript
import {  } from '';
import * as fs from 'fs';

const configuration = .createConfiguration();
const apiInstance = new .ContactsRoleApiApi(configuration);

let body:.ContactsRoleApiApiAddRoleMembersRequest = {
  // AddRoleMemberRo
  addRoleMemberRo: {
    unitList: [
      {
        id: 120322719823,
        type: 1,
      },
    ],
  },
  // number
  roleId: 1,
  // string | space id
  xSpaceId: "spcyQkKp9XJEl",
  // string
  roleId2: "15622",
};

apiInstance.addRoleMembers(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

NameTypeDescriptionNotes
addRoleMemberRoAddRoleMemberRo
roleId[number]defaults to undefined
xSpaceId[string]space iddefaults to undefined
roleId2[string]defaults to undefined

Return type

ResponseDataVoid

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createRole

ResponseDataVoid createRole(createRoleRo, )

create new role

Example

typescript
import {  } from '';
import * as fs from 'fs';

const configuration = .createConfiguration();
const apiInstance = new .ContactsRoleApiApi(configuration);

let body:.ContactsRoleApiApiCreateRoleRequest = {
  // CreateRoleRo
  createRoleRo: {
    roleName: "Finance",
    position: 2000,
  },
  // string | space id
  xSpaceId: "spcyQkKp9XJEl",
};

apiInstance.createRole(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

NameTypeDescriptionNotes
createRoleRoCreateRoleRo
xSpaceId[string]space iddefaults to undefined

Return type

ResponseDataVoid

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteRole1

ResponseDataVoid deleteRole1()

delete role

Example

typescript
import {  } from '';
import * as fs from 'fs';

const configuration = .createConfiguration();
const apiInstance = new .ContactsRoleApiApi(configuration);

let body:.ContactsRoleApiApiDeleteRole1Request = {
  // number
  roleId: 1,
  // string | space id
  xSpaceId: "spcyQkKp9XJEl",
  // string
  roleId2: "15622",
};

apiInstance.deleteRole1(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

NameTypeDescriptionNotes
roleId[number]defaults to undefined
xSpaceId[string]space iddefaults to undefined
roleId2[string]defaults to undefined

Return type

ResponseDataVoid

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getRoleMembers

ResponseDataPageInfoRoleMemberVo getRoleMembers()

query the role's members

Example

typescript
import {  } from '';
import * as fs from 'fs';

const configuration = .createConfiguration();
const apiInstance = new .ContactsRoleApiApi(configuration);

let body:.ContactsRoleApiApiGetRoleMembersRequest = {
  // number
  roleId: 1,
  // PageVoid
  page: {
    records: [
      {},
    ],
    total: 1,
    size: 1,
    current: 1,
    orders: [
      {
        column: "column_example",
        asc: true,
      },
    ],
    optimizeCountSql: true,
    searchCount: true,
    optimizeJoinOfCountSql: true,
    countId: "countId_example",
    maxLimit: 1,
    pages: 1,
  },
  // string | space id
  xSpaceId: "spcyQkKp9XJEl",
  // string
  roleId2: "15622",
  // string | page parameters
  pageObjectParams: "{"pageNo":1,"pageSize":20}",
};

apiInstance.getRoleMembers(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

NameTypeDescriptionNotes
roleId[number]defaults to undefined
pagePageVoiddefaults to undefined
xSpaceId[string]space iddefaults to undefined
roleId2[string]defaults to undefined
pageObjectParams[string]page parametersdefaults to undefined

Return type

ResponseDataPageInfoRoleMemberVo

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getRoles

ResponseDataListRoleInfoVo getRoles()

query the space's roles

Example

typescript
import {  } from '';
import * as fs from 'fs';

const configuration = .createConfiguration();
const apiInstance = new .ContactsRoleApiApi(configuration);

let body:.ContactsRoleApiApiGetRolesRequest = {
  // string | space id
  xSpaceId: "spcyQkKp9XJEl",
};

apiInstance.getRoles(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

NameTypeDescriptionNotes
xSpaceId[string]space iddefaults to undefined

Return type

ResponseDataListRoleInfoVo

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

initRoles

ResponseDataVoid initRoles()

create init role

Example

typescript
import {  } from '';
import * as fs from 'fs';

const configuration = .createConfiguration();
const apiInstance = new .ContactsRoleApiApi(configuration);

let body:.ContactsRoleApiApiInitRolesRequest = {
  // string | space id
  xSpaceId: "spcyQkKp9XJEl",
};

apiInstance.initRoles(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

NameTypeDescriptionNotes
xSpaceId[string]space iddefaults to undefined

Return type

ResponseDataVoid

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

removeRoleMembers

ResponseDataVoid removeRoleMembers(deleteRoleMemberRo, )

remove role members

Example

typescript
import {  } from '';
import * as fs from 'fs';

const configuration = .createConfiguration();
const apiInstance = new .ContactsRoleApiApi(configuration);

let body:.ContactsRoleApiApiRemoveRoleMembersRequest = {
  // DeleteRoleMemberRo
  deleteRoleMemberRo: {
    unitIds: [
      1,
    ],
  },
  // number
  roleId: 1,
  // string | space id
  xSpaceId: "spcyQkKp9XJEl",
  // string
  roleId2: "15622",
};

apiInstance.removeRoleMembers(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

NameTypeDescriptionNotes
deleteRoleMemberRoDeleteRoleMemberRo
roleId[number]defaults to undefined
xSpaceId[string]space iddefaults to undefined
roleId2[string]defaults to undefined

Return type

ResponseDataVoid

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateRole

ResponseDataVoid updateRole(updateRoleRo, )

update role information

Example

typescript
import {  } from '';
import * as fs from 'fs';

const configuration = .createConfiguration();
const apiInstance = new .ContactsRoleApiApi(configuration);

let body:.ContactsRoleApiApiUpdateRoleRequest = {
  // UpdateRoleRo
  updateRoleRo: {
    roleName: "finance",
  },
  // number
  roleId: 1,
  // string | space id
  xSpaceId: "spcyQkKp9XJEl",
  // string
  roleId2: "15622",
};

apiInstance.updateRole(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

NameTypeDescriptionNotes
updateRoleRoUpdateRoleRo
roleId[number]defaults to undefined
xSpaceId[string]space iddefaults to undefined
roleId2[string]defaults to undefined

Return type

ResponseDataVoid

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]