Agency

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": true
      }, // ... 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”

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",
        "Logon": false
    },
    {
        "Rep": "Mr. Rep",
        "RepID": 4168,
        "Type": "Rep",
        "Username": "mrrep",
        "Logon": false
    }
]
%d bloggers like this: