API RepEdit
RepEdit(
object Rep,
bool InviteUser,
bool WebhookEvaluate
)
Edit a rep user’s information.
Available since RPM29
Request
Request Data:
- (object) Rep (required) – the rep’s data
- (int) RepID (required) – identify the rep to edit by its ID
- (string) Username (optional) – change the rep’s username
- (string) Company (optional) – the rep’s company name
- (bool) Enabled (optional, default false) – if the rep’s user can sign in
- (bool) CommissionsHidden (optional, default false) – if the reps is allowed to see sales commission
- (enum) Relationship (optional, default Employee) – whether the rep is an Employee or a SubAgent
- (object) Contact (required) – The rep’s contact information
- (string) Salutation (optional)
- (string) FirstName (optional)
- (string) LastName (optional)
- (string) Title (optional)
- (string) Email (optional) – Must be valid if InviteUser is true
- (array) PhoneNumbers(optional) – a list of up to 4 phone numbers, each using the following structure
- (string) Number (optional) – the phone number
- (enum) Type (optional) – number indicating the type of phone number it is (there cannot be repeated types): 1-Business, 2-Home, 3-Fax, 4-Other
- (array) Fields(optional) – a list of basic fields to fill in, each using the following structure:
- (string) Field (optional) – the field name
- (string) Value (optional) – the field value
- (array) AssignmentCodes (optional) – a list of existing assignment codes to give the rep
- (int) SupplierID (optional) – the supplier
- (string) AssignmentCode (optional) – the assignment code
- (bool) InviteUser (optional, default: false) – whether to send an email to the new user so they can finish setting up their account
- (bool) WebhookEvaluate (optional, default: false) – whether RPM should issue webhook requests
{
"Rep": {
"RepID": <int>,
"Company": <string>,
"Username": <string>,
"Enabled": <bool>,
"CommissionsHidden": <bool>,
"Relationship": <enum 0=Employee, 1=SubAgent>,
"Contact": {
"Salutation": <string>,
"FirstName": <string>,
"LastName": <string>,
"Title": <string>,
"Email": <string>,
"PhoneNumbers": [
{
"PhoneNumberID": <int>,
"Type": <enum 1=Business, 2=Home, 3=Fax, 6=Other>,
"Number": <string>
}, // ... 1 per Type
]
},
"Fields": [ // optional
{
"Field": <string>,
"Value": <string>
},
// ... more fields
],
"AssignmentCodes": [
{
"SupplierID": <int>,
"AssignmentCode": <string>
},
// ... more assignment codes
]
},
"InviteUser": <bool>, // default: false
"WebhookEvaluate": <bool>, // default: false
}
Response
{
"Result": {
"Added": <Date>,
"Agency": <string>,
"AgencyID": <int>,
"AgencyArchived": <bool>, // Since RPM29
"AssignmentCodes": [
{
"AssignmentCode": <string>, // ID
"Supplier": <string>,
"SupplierID": <int>
},
<... more AssignmentCodes>
],
"CommissionsHidden": <bool>,
"Contact": {
"ContactID": <int>,
"Email": <string>,
"FirstName": <string>,
"LastName": <string>,
"PhoneNumbers": [
{
"Number": <string>,
"PhoneNumberID": <int>,
"Type": <enum: Business=1, Home=2, Fax=3, Other=6>
},
<... more PhoneNumbers (1 for each type)>
],
"Salutation": <string>,
"Title": <string>
},
"Fields": [
{
"Field": <string>, // Field Name
"Value": <string>
},
... <more custom fields>
],
"Enabled": <bool>, // Added in RPM27, replaced Logon
"Modified": <date>,
"NotesForStaff": [],
"Relationship": <string>,
"Rep": <string>,
"RepID": <int>,
"MgrID": <int>, // Since RPM29 (if the rep is also a manager)
"Type": <string>,
"Username": <string>,
"UserID": <int>, // Since RPM29
}
}
Notes
- Enabling users will affect costs starting in the current billing cycle.
- Disabling users will take effect on the next billing cycle.
Errors
- “Rep not found” – the provided rep ID does not exist
- “Invite requires a valid email address” – RPM will use the email sent in the request if provided, otherwise it uses the rep’s current email address.
- "Call requires parameter: \"Contact.FirstName\" which was not found"
- "Call requires parameter: \"Contact.LastName\" which was not found"
- “Unrecognized type for phone number: <int>” – when a phone number type is not a valid one from the enum
- "Call requires parameter: \"Rep\" which was not found"