Clients - GetBric/API GitHub Wiki

Clients Index

  • Route: /clients
  • Method: GET
  • Expected Response:
{
  "clients": [
    {
      "id": 1070822778,
      "link": "https://api.getbric.com/v1/clients/1070822778",
      "name": "Yahoo",
      "address": "44 Main Street",
      "city": "Seattle",
      "state": "WA",
      "zip": "55555",
      "country": "USA",
      "phone": "444-333-2222",
      "projects": [
        {
          "id": 1052037185,
          "link": "https://api.getbric.com/v1/projects/1052037185",
          "name": "Homepage Redesign",
          "code": "D-987",
          "description": "New mobile homepage",
          "color": "#E0E3AA",
          "project_type": {
            "id": 44,
            "link": "https://api.getbric.com/v1/project_types/44",
            "name": "Development",
            "billable": true
          }
        },
        {
          "id": 1052037180,
          "link": "https://api.getbric.com/v1/projects/1052037180",
          "name": "Checkout Page Resign",
          "code": "D-988",
          "description": "Checkout page workflow fix",
          "color": "#7BC3CA",
          "project_type": {
            "id": 44,
            "link": "https://api.getbric.com/v1/project_types/44",
            "name": "Development",
            "billable": true
          }
        }
      ],
      "created_at": "2016-01-20T13:13:31.603-05:00",
      "updated_at": "2016-01-20T13:13:31.603-05:00"
    },
    {
      "id": 1007229162,
      "link": "https://api.getbric.com/v1/clients/1007229162",
      "name": "Google",
      "address": "99 Dodge St.",
      "city": "Omaha",
      "state": "NE",
      "zip": "99995",
      "country": "USA",
      "phone": "555-444-3339,
      "projects": [
        {
          "id": 1052037171,
          "link": "https://api.getbric.com/v1/projects/1052037171",
          "name": "App Integration",
          "code": "G-5598",
          "description": "Integrate Google advertising with mobile app store",
          "color": "#AB679D",
          "project_type": {
            "id": 36,
            "link": "https://api.getbric.com/v1/project_types/36",
            "name": "Research & Development",
            "billable": true
          }
        },
        {
          "id": 1052037169,
          "link": "https://api.getbric.com/v1/projects/1052037169",
          "name": "Ad Campaign",
          "code": "AD-555",
          "description": "Web Advertising Campaign",
          "color": "#737260",
          "project_type": null
        }
      ],
      "created_at": "2015-11-19T01:26:01.000-05:00",
      "updated_at": "2015-11-19T01:26:01.000-05:00"
    }
  ]
}

Client Create

  • Route: /clients
  • Method: POST
  • Required Fields:
    • name
  • Allowed Fields:
    • phone
    • address
    • city
    • state
    • zip
    • country
  • Expected Response:
{
  "clients": {
    "id": 1070822810,
    "link": "https://api.getbric.com/v1/clients/1070822810",
    "name": "Facebook",
    "address": "456 N. 99th St.",
    "city": "Boston",
    "state": "MA",
    "zip": "76543",
    "country": "USA",
    "phone": "987-654-3332",
    "projects": [],
    "created_at": "2016-04-14T17:20:40.733-04:00",
    "updated_at": "2016-04-14T17:20:40.733-04:00"
  }
}

Client Show

  • Route: /clients/id
  • Method: GET
  • Expected Response:
{
  "clients": {
    "id": 1070822778,
    "link": "https://api.getbric.com/v1/clients/1070822778",
    "name": "Yahoo",
    "address": "44 Main Street",
    "city": "Seattle",
    "state": "WA",
    "zip": "55555",
    "country": "USA",
    "phone": "444-333-2222",
    "projects": [
      {
        "id": 1052037185,
        "link": "https://api.getbric.com/v1/projects/1052037185",
        "name": "Homepage Redesign",
        "code": "D-987",
        "description": "New mobile homepage",
        "color": "#E0E3AA",
        "project_type": {
          "id": 44,
          "link": "https://api.getbric.com/v1/project_types/44",
          "name": "Development",
          "billable": true
        }
      }
    ],
    "created_at": "2016-01-20T13:13:31.603-05:00",
    "updated_at": "2016-04-14T17:25:14.004-04:00"
  }
}

Client Update

  • Route: /clients/id
  • Method: PATCH
  • Allowed Fields:
    • name
    • phone
    • address
    • city
    • state
    • zip
    • country
  • Expected Response:
{
  "clients": {
    "id": 1070822778,
    "link": "https://api.getbric.com/v1/clients/1070822778",
    "name": "Yahoo",
    "address": "44 Main Street",
    "city": "Seattle",
    "state": "WA",
    "zip": "55555",
    "country": "USA",
    "phone": "444-333-2222",
    "projects": [
      {
        "id": 1052037185,
        "link": "https://api.getbric.com/v1/projects/1052037185",
        "name": "Homepage Redesign",
        "code": "D-987",
        "description": "New mobile homepage",
        "color": "#E0E3AA",
        "project_type": {
          "id": 44,
          "link": "https://api.getbric.com/v1/project_types/44",
          "name": "Development",
          "billable": true
        }
      }
    ],
    "created_at": "2016-01-20T13:13:31.603-05:00",
    "updated_at": "2016-04-14T17:25:14.004-04:00"
  }
}

Client Destroy

  • Route: /clients/id
  • Method: DELETE
  • Expected Response:
{
  "clients": {
    "id": 1070822778,
    "link": "https://api.getbric.com/v1/clients/1070822778",
    "name": "Yahoo",
    "address": "44 Main Street",
    "city": "Seattle",
    "state": "WA",
    "zip": "55555",
    "country": "USA",
    "phone": "444-333-2222",
    "projects": [
      {
        "id": 1052037185,
        "link": "https://api.getbric.com/v1/projects/1052037185",
        "name": "Homepage Redesign",
        "code": "D-987",
        "description": "New mobile homepage",
        "color": "#E0E3AA",
        "project_type": {
          "id": 44,
          "link": "https://api.getbric.com/v1/project_types/44",
          "name": "Development",
          "billable": true
        }
      }
    ],
    "created_at": "2016-01-20T13:13:31.603-05:00",
    "updated_at": "2016-04-14T17:25:14.004-04:00"
  }
}