RepAdd(    object Rep,    bool InviteUser,    bool WebhookEvaluate )

Add a rep user to an agency.

Available since RPM29

Request

Request Data:

  • (object) Rep (required) – the rep’s data
    • (int) AgencyID (required) – The Agency that the rep will be part of
    • (bool) IsAlsoManager (optional, default false) – if the rep is also a manager
    • (string) Company (optional) – the rep’s company name
    • (string) Username (required) – the username for the rep’s user
    • (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 (required)
      • (string) LastName (required)
      • (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": {
        "AgencyID": <int>, // required
        "IsAlsoManager": <bool>, // default: false
        "Company": <string>, // default: empty string
        "Username": <string>, // required
        "Enabled": <bool>, // default: false
        "CommissionsHidden": <bool>, // default: false
        "Relationship": <enum 0=Employee, 1=SubAgent>, // default: 0 (Employee)
        "Contact": { // required
            "Salutation": <string>, // optional
            "FirstName": <string>, // required
            "LastName": <string>, // required
            "Title": <string>, // optional
            "Email": <string>, // optional
            "PhoneNumbers": [ // optional
                {
                    "Type": <enum 1=Business, 2=Home, 3=Fax, 6=Other>,
                    "Number": <string>
                }, // ... 1 per Type
            ]
        },
        "Fields": [ // optional
            {
                "Field": <string>,
                "Value": <string>
            },
            // ... more fields
        ],
        "AssignmentCodes": [ // optional
            {
                "SupplierID": <int>,
                "AssignmentCode": <string>
            },
            // ... more assignment codes
        ]
    },
    "InviteUser": <bool>, // default: false
    "WebhookEvaluate": <bool>, // default: false
}

Response

Same structure as the Rep endpoint.

Notes

  • Enabling users will affect costs starting in the current billing cycle.

Errors

  • “Agency not found” – the provided agency does not exist
  • “Call requires parameter: “Username” which was not found” – If the username is not provided or is empty
  • “Invite requires a valid email address”
  • “Call requires parameter: “Contact.FirstName” which was not found” – If the first name is not provided or is empty
  • “Call requires parameter: “Contact.LastName” which was not found” – If the last name is not provided or is empty
  • “Unrecognized type for phone number: <int>” – when a phone number type is not a valid one from the enum
  • “User cap would be exceeded” – if there’s a user cap for rep/manager