Agency(
    string Agency,
    int AgencyID 
)

Get information for one agency.

Request

Request Data:

  • (string) Agency (optional) – Identify the Agency by Name.
  • (int) AgencyID (required) – Identify the Agency by ID (if Agency is provided, it will be ignored).
{
    "Agency" : <string>,
    "AgencyID" : <int>
}

Response:

{
  "Result": {
    "Agency": <string>,
    "AgencyID": <int>,
    "Archived": <bool>,
    "AgencyGroupID": <int>,
    "AgencyGroup": <string>,
    "Website": <string>,
    "Address": <string>,
    "City": <string>,
    "StateProvince": <string>,
    "Country": <string>,
    "ZipPostalCode": <string>,
    "Added": <string>,
    "Modified": <string>,
    "Contact": { // Note: before RPM20 all the attributes of Contact were directly under Result
      "ContactID": <int>,
      "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>
        }, // ... 3 more (1 per Type)
      ]
    },
    "Fields": [
      {
        "Field": <string>,
        "Uid": <string>,
        "Format": <int>,
        "Value": ""
      }, // ... More custom fields
    ],
    "Reps": [
      {
        "Rep": <string>,
        "RepID": <int>,
        "Type": <string>,
        "Username": <string>,
        "Logon": <bool>, // Removed in RPM27
        "Enabled": <bool>, // Added in RPM27, replaced Logon
      }, // ... More Reps
    ],
    "NotesForStaff": [
      {
        "Added": <string>,
        "By": <string>,
        "Note": <string>
      }, //... More notes
    ],
    "SupplierExclusions": [
      {
        "Supplier": <string>,
        "SupplierID": <int>
      }, //... More Supplier exclusions
    ],
    "StaffAssignment": [
      {
        "Category": <string>,
        "Name": <string>,
        "StaffID": <int>,
        "Username": <string>
      }, //... More Staff Assignments
    ]
  }
}

Errors

  • “Agency not found”
  • User lacks permission – the user must have access to the “Agencies and reps section” privilege. (Since RPM25)

Notes

The Reps property will contain repeated entries for Reps that are also Managers, they can be matched by the username, for example:

"Reps": [
    {
        "Rep": "Mr. Rep",
        "RepID": 16,
        "Type": "Manager",
        "Username": "mrrep",
        "Enabled": false
    },
    {
        "Rep": "Mr. Rep",
        "RepID": 4168,
        "Type": "Rep",
        "Username": "mrrep",
        "Enabled": false
    }
]