Agency

Get leads

For agencies

GET /leads/assignable – not assigned yet
GET /leads/rejected – rejected and should be re-assigned
GET /leads/escalated – escalated and should be called
GET /leads/revoked – revoked and should be re-assigned (or deleted)

Query string parameters

  • team_id integer – Can be used when calling the rejected or escalated endpoint.
  • lead_type_id UUID – Get leads only with that lead type.
  • start_date date
    • Y-m-d H:i:s format
    • Must be before end_date
  • end_date date
    • Y-m-d H:i:s format
    • Must be after start_date
  • Supports Sorting
    • Can be created_at, updated_at or external_weight
    • default: updated_at
  • Supports Pagination

Response
Status code 200

Get dealer teams

GET /agency/dealers

This is only available to users with the Agency right, and will display all dealer teams.

Query string parameters

  • group_id integer
  • Supports Sorting
    • Can be created_at, updated_at or external_weight
    • default: created_at
  • Supports Pagination

Response
Status code 200

{
  "data": [
    {
      "id": 12,
      "name": "Dealership Cruickshank-Tillman",
      "address_1": "64064 Graham Springs",
      "address_2": "88384 Jonathon Road",
      "zip_code": "1110",
      "city": "North Hazelbury",
      "state": "New Carleyborough",
      "country": {
        "name": "South Africa",
        "native_name": "South Africa",
        "code": "ZA"
      },
      "phone_number": "400-856-1857",
      "website": "http://www.Lind.com/",
      "vat": "1234567890123456",
      "team_type": "dealer",
      "group_id": null,
      "created_at": "2014-01-01 12:45:56",
      "updated_at": "2014-01-02 00:11:22"
    },
    {
      "id": 11,
      "name": "Dealership EASIR",
      "address_1": "2808 Demarcus Points Suite 859",
      "address_2": "145 Keeling Parkway Suite 413",
      "zip_code": "1004",
      "city": "Predovichaven",
      "state": "East Bobby",
      "country": {
        "name": "South Africa",
        "native_name": "South Africa",
        "code": "ZA"
      },
      "phone_number": "(854)393-4364x500",
      "website": "http://Kuphal.com/earum-dolores-modi-veritatis-nesciunt-et-sed-quisquam",
      "vat": "1234567890123456",
      "team_type": "dealer",
      "group_id": null,
      "created_at": "2014-01-01 12:45:56",
      "updated_at": "2014-01-02 00:11:22"
    }
  ],
  "pagination": {
    "total": 2,
    "page": 1,
    "per_page": 15,
    "urls": {
      "previous": null,
      "next": null
    }
  }
}

Get specific dealer

GET /agency/dealers/:dealerId

Response
Status code 200

{
  "id": 37,
  "name": "dealer",
  "address_1": "88567 Cecelia Rapid Apt. 522",
  "address_2": "",
  "zip_code": "18505-7883",
  "city": "Lake Miles",
  "state": "Vanessaberg",
  "country": {
    "name": "Qatar",
    "native_name": "قطر",
    "code": "QA"
  },
  "phone_number": "+64(3)1521349757",
  "website": "http://www.Goldner.com/quam-voluptatem-perferendis-omnis-numquam",
  "vat": "1234567890123456",
  "timezone": {
    "name": "America/Rosario",
    "offset": -10800
  },
  "locale": {
    "code": "zu-ZA",
    "language_name": "isiZulu",
    "country": {
      "name": "South Africa",
      "native_name": "South Africa",
      "code": "ZA"
    }
  },
  "team_type": "dealer",
  "group_id": null,
  "created_at": "2016-02-24 15:17:48",
  "updated_at": "2016-02-24 15:17:48"
}

Assign a lead

PUT /leads/:lead_id/assign/:team_id

Response
Status code 200

Mark lead as called

PUT /leads/:lead_id/call

Response
Status code 200

Get teams for lead assignment

GET /leads/teams/:lead_id

This retrieves a list of teams of the type dealer for use with lead assignment.

Response
Status code 200

{
  "data": [
    {
      "id": 11,
      "name": "Dealership Mosciski-Schinner",
      "address_1": "59041 Pascale Course",
      "address_2": "7187 Justine Underpass Apt. 011",
      "zip_code": "1003",
      "city": "Lake Estellport",
      "state": "Port Lazaro",
      "country": null,
      "phone_number": "291.101.2853x631",
      "website": "http://White.com/",
      "vat": "1234567890123456",
      "group": null,
      "team_type": "dealer",
      "created_at": "2014-01-01 12:45:56",
      "updated_at": "2014-01-02 00:11:22",
      "case_count": null
    },
    {
      "id": 12,
      "name": "Dealership Bergnaum, Morar and Streich",
      "address_1": "42272 Jasper Parkway",
      "address_2": "8710 Luettgen Forges Suite 568",
      "zip_code": "1108",
      "city": "Jacksonchester",
      "state": "Port Jaredview",
      "country": null,
      "phone_number": "08956815800",
      "website": "http://Hettinger.com/voluptatibus-omnis-veritatis-placeat-itaque-illo",
      "vat": "1234567890123456",
      "group": null,
      "team_type": "dealer",
      "created_at": "2014-01-01 12:45:56",
      "updated_at": "2014-01-02 00:11:22",
      "case_count": null
    }
  ]
}