Account Representatives Queries

Retrieve account representatives assigned to customers.

Available queries

AccountRepresentative - Returns a single account representative based on the id provided

query {
  AccountRepresentative (id: 100012) {
    label
    email
  }
}

AccountRepresentatives - Returns a list of account representatives based on the filter defined

query {
  AccountRepresentatives {
    data {
      label
      email
      active
    }
  }
}


Available fields

FieldTypeDescription
idIntUnique identifier of the account representative.
labelStringThe full name of the account representative.
first_nameStringThe first name of the account representative.
last_nameStringThe last name of the account representative.
phoneStringThe phone number of the account representative.
emailStringThe email address of the account representative.
activeBooleanIf true, the account representative is active.
created_atDateTimeCreation date of the account representative.
updated_atDateTimeDate of the latest update of the account representative.

Filters

You can create filters based on following fields

id
Example: { column": "ID", "operator": "EQ", "value": "100001" }
label
Example: { "column" : "LABEL", "operator" : "LIKE", "value" : "%Ford%" }
first_name
Example: { "column" : "FIRST_NAME", "operator" : "EQ", "value" : "John" }
last_name
Example: { column": "LAST_NAME", "operator": "NEQ", "value": "Ford"
email
Example: { "column": "EMAIL", "operator": "LIKE", "value": "%samsung.com" }
active
Example: { column": "ACTIVE", "operator": "EQ", "value": true }
company_id
Example: { column": "COMPANY_ID", "operator": "EQ", "value": "71357171" }
created_at
Example: { "column": "CREATED_AT", "operator": "LT", "value": "2023-03-03 15:55:32" }
updated_at
Example: { "column": "UPDATED_AT", "operator": "GT", "value": "2023-03-03 15:55:32" }

Sorting

You can sort data based on following fields : id, label, first_name,
last_name, email, active, created_at, updated_at

query AccountRepresentatives(
  $where: QueryAccountRepresentativesWhereWhereConditions, 
) {
  AccountRepresentatives(
    orderBy: [{column: LABEL, order: ASC}]
    where: $where
  ) {
    paginatorInfo {
      total
    }
    data {
      id
      label
      email
      created_at
    }
  }
}
{
  "where": {
    "AND": [
      {
        "column": "ACTIVE",
        "operator": "EQ",
        "value": true
      }
    ]
  }
}

Example of data returned

{
  "data": {
    "AccountRepresentatives": {
      "paginatorInfo": {
        "total": 1
      },
      "data": [
        {
          "id": 100002,
          "label": "John Ford",
          "email": "[email protected]",
          "created_at": "2019-08-24"
        }
      ]
    }
  }
}