Skip to content

Latest commit

 

History

History
769 lines (515 loc) · 20.7 KB

UsersApi.md

File metadata and controls

769 lines (515 loc) · 20.7 KB

Pipedrive.UsersApi

All URIs are relative to https://api.pipedrive.com/v1

Method HTTP request Description
addUser POST /users Add a new user
addUserBlacklistedEmail POST /users/{id}/blacklistedEmails Add blacklisted email address for a user
addUserRoleAssignment POST /users/{id}/roleAssignments Add role assignment
deleteUserRoleAssignment DELETE /users/{id}/roleAssignments Delete a role assignment
findUsersByName GET /users/find Find users by name
getCurrentUser GET /users/me Get current user data
getUser GET /users/{id} Get one user
getUserBlacklistedEmails GET /users/{id}/blacklistedEmails List blacklisted email addresses of a user
getUserFollowers GET /users/{id}/followers List followers of a user
getUserPermissions GET /users/{id}/permissions List user permissions
getUserRoleAssignments GET /users/{id}/roleAssignments List role assignments
getUserRoleSettings GET /users/{id}/roleSettings List user role settings
getUsers GET /users Get all users
updateUser PUT /users/{id} Update user details

addUser

User addUser(name, email, activeFlag)

Add a new user

Adds a new user to the company, returns the ID upon success.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
let name = "name_example"; // String | Name of the user
let email = "email_example"; // String | Email of the user
let activeFlag = true; // Boolean | Whether the user is active or not. false = Not activated, true = Activated
apiInstance.addUser(name, email, activeFlag).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
name String Name of the user
email String Email of the user
activeFlag Boolean Whether the user is active or not. false = Not activated, true = Activated [default to true]

Return type

User

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

addUserBlacklistedEmail

Object addUserBlacklistedEmail(id, address)

Add blacklisted email address for a user

Add blacklisted email address for a specific user.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
let id = 56; // Number | ID of the user
let address = "address_example"; // String | Email address to blacklist (can contain \\\\\\\\* for wildcards, e.g. \\\\\\\\*@example.com, or john\\\\\\\\*@ex\\\\\\\\*.com)
apiInstance.addUserBlacklistedEmail(id, address).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the user
address String Email address to blacklist (can contain \\\\* for wildcards, e.g. \\\\@example.com, or john\\\\@ex\\\\*.com)

Return type

Object

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

addUserRoleAssignment

PostRoleAssignment addUserRoleAssignment(id, roleId)

Add role assignment

Add role assignment for a user

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new Pipedrive.UsersApi();
let id = 56; // Number | ID of the user
let roleId = 56; // Number | ID of the role
apiInstance.addUserRoleAssignment(id, roleId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the user
roleId Number ID of the role

Return type

PostRoleAssignment

Authorization

api_key

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

deleteUserRoleAssignment

DeleteRoleAssignment deleteUserRoleAssignment(id, roleId)

Delete a role assignment

Delete a role assignment for a user

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new Pipedrive.UsersApi();
let id = 56; // Number | ID of the user
let roleId = 56; // Number | ID of the role
apiInstance.deleteUserRoleAssignment(id, roleId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the user
roleId Number ID of the role

Return type

DeleteRoleAssignment

Authorization

api_key

HTTP request headers

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

findUsersByName

Users findUsersByName(term, opts)

Find users by name

Finds users by their name.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
let term = "term_example"; // String | Search term to look for
let opts = {
  'searchByEmail': new Pipedrive.NumberBooleanDefault0() // NumberBooleanDefault0 | When enabled, term will only be matched against email addresses of users. Default: false
};
apiInstance.findUsersByName(term, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
term String Search term to look for
searchByEmail NumberBooleanDefault0 When enabled, term will only be matched against email addresses of users. Default: false [optional]

Return type

Users

Authorization

api_key, oauth2

HTTP request headers

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

getCurrentUser

UserMe getCurrentUser()

Get current user data

Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the 'locale' property means 'Date and number format' in the Pipedrive settings, not the chosen language.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
apiInstance.getCurrentUser().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

UserMe

Authorization

api_key, oauth2

HTTP request headers

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

getUser

User getUser(id)

Get one user

Returns data about a specific user within the company

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
let id = 56; // Number | ID of the user
apiInstance.getUser(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the user

Return type

User

Authorization

api_key, oauth2

HTTP request headers

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

getUserBlacklistedEmails

Object getUserBlacklistedEmails(id)

List blacklisted email addresses of a user

Lists blacklisted email addresses of a specific user. Blacklisted emails are such that will not get synced in to Pipedrive when using the built-in Mailbox.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
let id = 56; // Number | ID of the user
apiInstance.getUserBlacklistedEmails(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the user

Return type

Object

Authorization

api_key, oauth2

HTTP request headers

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

getUserFollowers

UserIDs getUserFollowers(id)

List followers of a user

Lists followers of a specific user.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
let id = 56; // Number | ID of the user
apiInstance.getUserFollowers(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the user

Return type

UserIDs

Authorization

api_key, oauth2

HTTP request headers

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

getUserPermissions

UserPermissions getUserPermissions(id)

List user permissions

List aggregated permissions over all assigned permission sets for a user

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
let id = 56; // Number | ID of the user
apiInstance.getUserPermissions(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the user

Return type

UserPermissions

Authorization

api_key, oauth2

HTTP request headers

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

getUserRoleAssignments

GetRoleAssignments getUserRoleAssignments(id, opts)

List role assignments

List role assignments for a user

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new Pipedrive.UsersApi();
let id = 56; // Number | ID of the user
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56 // Number | Items shown per page
};
apiInstance.getUserRoleAssignments(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the user
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]

Return type

GetRoleAssignments

Authorization

api_key

HTTP request headers

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

getUserRoleSettings

GetRoleSettings getUserRoleSettings(id)

List user role settings

List settings of user's assigned role

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
let id = 56; // Number | ID of the user
apiInstance.getUserRoleSettings(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the user

Return type

GetRoleSettings

Authorization

api_key, oauth2

HTTP request headers

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

getUsers

Users getUsers()

Get all users

Returns data about all users within the company

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
apiInstance.getUsers().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

Users

Authorization

api_key, oauth2

HTTP request headers

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

updateUser

User updateUser(id, activeFlag)

Update user details

Updates the properties of a user. Currently, only active_flag can be updated.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.UsersApi();
let id = 56; // Number | ID of the user
let activeFlag = true; // Boolean | Whether the user is active or not. false = Not activated, true = Activated
apiInstance.updateUser(id, activeFlag).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the user
activeFlag Boolean Whether the user is active or not. false = Not activated, true = Activated [default to true]

Return type

User

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json