Difference between revisions of "Clients"

From Advice Local Wiki
Jump to: navigation, search
(Example Response)
(Example Response)
Line 549: Line 549:
 
==== Example Request ====
 
==== Example Request ====
 
==== Example Response ====
 
==== Example Response ====
 +
<syntaxhighlight lang="json">
 
{
 
{
 
     "status": 200,
 
     "status": 200,
Line 557: Line 558:
 
             "imageArray": "test-image.png",
 
             "imageArray": "test-image.png",
 
             "imageObject": "{}",
 
             "imageObject": "{}",
             "client": 3201926
+
             "client": 12345
 
         }
 
         }
 
     ]
 
     ]
 
}
 
}
 +
</syntaxhighlight>
  
 
=== Add an Image with a Tag ===
 
=== Add an Image with a Tag ===

Revision as of 12:25, 13 December 2017

The Client Object

Attributes
id integer Unique identifier for the object.
name string (maxLength=128) required The busniess name.
owner string (maxLength=128) optional The business owner's name.
street string (maxLength=128) required The business street.
suite string (maxLength=32) optional The business suite.
hours The business hours.
city string (maxLength=128) required The business city.
state string (maxLength=64) required The business state.
zipcode string (maxLength=32) required The business zipcode.
phone string (maxLength=32) required The business phone number.
phoneAlt string (maxLength=32) optional The business additional phone number.
fax string (maxLength=32) optional The business fax number.
website string (maxLength=32) optional The business website.
email string (maxLength=32) optional The business email address.
facebook string (maxLength=32) optional The business facebook url.
twitter string (maxLength=32) optional The business twitter url.
linkedin string (maxLength=32) optional The business linkedIn url.
years string (maxLength=32) optional Number of years in business.
description string optional The business description.
payment string optional Payment Types Accepted by the business.
license string (maxLength=64) optional The business license.
keyword1 string (maxLength=64) optional The business keyword 1.
keyword2 string (maxLength=64) optional The business keyword 2.
keyword3 string (maxLength=64) optional The business keyword 3.
keyword4 string (maxLength=64) optional The business keyword 4.
keyword5 string (maxLength=64) optional The business keyword 5.
keyword1_location string (maxLength=128) optional The business keyword 1 location.
keyword2_location string (maxLength=128) optional The business keyword 2 location.
keyword3_location string (maxLength=128) optional The business keyword 3 location.
keyword4_location string (maxLength=128) optional The business keyword 4 location.
keyword5_location string (maxLength=128) optional The business keyword 5 location.
notes string optional Internal notes about the business.
custom1 string (maxLength=64) optional The custom1 field is for internal usage and replaces fkc1 in API Version 1.
custom2 string (maxLength=64) optional The custom2 field is for internal usage and replaces fkc2 in API Version 1.
custom3 string (maxLength=64) optional The custom3 field is for internal usage and replaces fkc3 in API Version 1.
custom4 string (maxLength=64) optional The custom4 field is for internal usage and replaces fkc4 in API Version 1.
custom5 string (maxLength=64) optional The custom5 field is for internal usage and replaces fkc5 in API Version 1.

Create a Client

API Endpoint

http://p.lssdev.com/legacyclients

Example Request

POST /legacyclients HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded

name=Gina+Pizza&street=3142+W+Balboa+Blvd&city=Newport+Beach&state=CA&zipcode=92663&phone=(949)+723-4462

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": {
        "status": "Inactive",
        "country": "US",
        "id": 12345,
        "name": "Gina Pizza",
        "partnerUsername": "dev@lssdev.com",
        "street": "3142 W Balboa Blvd",
        "city": "Newport Beach",
        "state": "CA",
        "zipcode": "92663",
        "phone": "(949) 723-4462",
        "hide": "false",
        "createdAt": "2017-12-12T23:59:44.077Z",
        "publicKey": "e343f4531abf70d03706727af93006c8",
        "partner": 7
    }
}

Get a Client

API Endpoint

http://p.lssdev.com/legacyclients/{client_id}

Example Request

GET /legacyclients/12345 HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": {
        "partner": 7,
        "gmb_token": null,
        "id": 12345,
        "suite": null,
        "deleted": "false",
        "LAT": null,
        "LON": null,
        "status": "Inactive",
        "country": "US",
        "orders": 0,
        "extra": "",
        "name": "Gina's Pizza",
        "owner": "",
        "partnerUsername": "dev@lssdev.com",
        "street": "3142 W Balboa Blvd",
        "hours": "",
        "city": "Newport Beach",
        "state": "CA",
        "zipcode": "92663",
        "phone": "(949) 723-4462",
        "phoneAlt": null,
        "fax": "",
        "website": "",
        "email": "",
        "facebook": "",
        "twitter": "",
        "linkedin": "",
        "years": "",
        "description": "",
        "payment": "",
        "services": "",
        "license": "",
        "keyword1": "",
        "keyword2": "",
        "keyword3": "",
        "keyword4": "",
        "keyword5": "",
        "keyword1_location": null,
        "keyword2_location": null,
        "keyword3_location": null,
        "keyword4_location": null,
        "keyword5_location": null,
        "notes": "",
        "hide": "false",
        "isInactive": false,
        "createdAt": "2017-12-12T23:59:44.000Z",
        "deletedAt": null,
        "inactiveAt": null,
        "custom1": "",
        "custom2": "",
        "custom3": "",
        "custom4": "",
        "custom5": "",
        "publicKey": "e343f4531abf70d03706727af93006c8",
        "tokenGoogle": null,
        "categoryGoogle": null,
        "transactionId": "4cd877f9-d339-4ee4-8de6-d4dd168f017c"
    }
}

Get all Clients

API Endpoint

http://p.lssdev.com/legacyclients

Example Request

GET /legacyclients HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": [
        {
            "partner": 7,
            "gmb_token": null,
            "id": 12345,
            "suite": null,
            "deleted": "true",
            "LAT": 0,
            "LON": 0,
            "status": "Paused",
            "country": "US",
            "orders": 0,
            "extra": "",
            "name": "",
            "owner": "",
            "partnerUsername": "dev@lssdev.com",
            "street": "2060 Broadway St",
            "hours": "",
            "city": "Boulder",
            "state": "CO",
            "zipcode": "80302",
            "phone": "(303) 444-8840",
            "phoneAlt": "",
            "fax": "",
            "website": "http://www.danday.com/?cmpid=loc3",
            "email": "",
            "facebook": "",
            "twitter": "",
            "linkedin": "",
            "years": "",
            "description": "",
            "payment": "",
            "services": "",
            "license": "",
            "keyword1": "",
            "keyword2": "",
            "keyword3": "",
            "keyword4": "",
            "keyword5": "",
            "keyword1_location": null,
            "keyword2_location": null,
            "keyword3_location": null,
            "keyword4_location": null,
            "keyword5_location": null,
            "notes": "",
            "hide": "false",
            "isInactive": true,
            "createdAt": "2014-03-25T11:24:15.000Z",
            "deletedAt": "2015-02-17T17:48:43.000Z",
            "inactiveAt": null,
            "custom1": "",
            "custom2": "",
            "custom3": "",
            "custom4": "",
            "custom5": "",
            "publicKey": "cb7e1c2ca63629c169f5937be15066c6",
            "tokenGoogle": null,
            "categoryGoogle": ""
        },
        {
            "partner": 7,
            "gmb_token": null,
            "id": 67890,
            "suite": null,
            "deleted": "true",
            "LAT": 0,
            "LON": 0,
            "status": "Paused",
            "country": "US",
            "orders": 0,
            "extra": "",
            "name": "Crosswind Advisors",
            "owner": "Kurt Wanner",
            "partnerUsername": "dev@lssdev.com",
            "street": "19125 N Creek Pkwy, Suite 120",
            "hours": "",
            "city": "Bothell",
            "state": "WA",
            "zipcode": "098011",
            "phone": "(425) 349-2527",
            "phoneAlt": "",
            "fax": "(425) 645-7870",
            "website": "www.crosswindadvisors.com",
            "email": "kurt@crosswindadvisors.com",
            "facebook": "",
            "twitter": "",
            "linkedin": "",
            "years": "",
            "description": "",
            "payment": "",
            "services": "",
            "license": "",
            "keyword1": "",
            "keyword2": "",
            "keyword3": "",
            "keyword4": "",
            "keyword5": "",
            "keyword1_location": null,
            "keyword2_location": null,
            "keyword3_location": null,
            "keyword4_location": null,
            "keyword5_location": null,
            "notes": "",
            "hide": "false",
            "isInactive": true,
            "createdAt": "2014-04-21T18:44:29.000Z",
            "deletedAt": "2015-02-17T17:48:43.000Z",
            "inactiveAt": null,
            "custom1": "",
            "custom2": "",
            "custom3": "",
            "custom4": "",
            "custom5": "",
            "publicKey": "f114082b24a58fd061f9f96b277a40f5",
            "tokenGoogle": null,
            "categoryGoogle": ""
        },
        {...},
        {...}
    ],
    "total": 20
}

Update a Client

API Endpoint

http://p.lssdev.com/legacyclients/{client_id}

Example Request

POST /legacyclients/12345 HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded


name=Gina's+Pizza&street=3142+W+Balboa+Blvd&city=Newport+Beach&state=CA&zipcode=92663&phone=(949)+723-4462

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": {
        "id": 12345,
        "suite": null,
        "deleted": "false",
        "LAT": null,
        "LON": null,
        "status": "Inactive",
        "country": "US",
        "orders": 0,
        "extra": "",
        "name": "Gina's Pizza",
        "owner": "",
        "partnerUsername": "dev@lssdev.com",
        "street": "3142 W Balboa Blvd",
        "hours": "",
        "city": "Newport Beach",
        "state": "CA",
        "zipcode": "92663",
        "phone": "(949) 723-4462",
        "phoneAlt": null,
        "fax": "",
        "website": "",
        "email": "",
        "facebook": "",
        "twitter": "",
        "linkedin": "",
        "years": "",
        "description": "",
        "payment": "",
        "services": "",
        "license": "",
        "keyword1": "",
        "keyword2": "",
        "keyword3": "",
        "keyword4": "",
        "keyword5": "",
        "keyword1_location": null,
        "keyword2_location": null,
        "keyword3_location": null,
        "keyword4_location": null,
        "keyword5_location": null,
        "notes": "",
        "hide": "false",
        "isInactive": false,
        "createdAt": "2017-12-12T23:59:44.000Z",
        "deletedAt": null,
        "inactiveAt": null,
        "custom1": "",
        "custom2": "",
        "custom3": "",
        "custom4": "",
        "custom5": "",
        "publicKey": "e343f4531abf70d03706727af93006c8",
        "tokenGoogle": null,
        "categoryGoogle": null,
        "partner": 7,
        "gmb_token": null
    }
}

Client Images

Add an Image

API Endpoint

http://p.lssdev.com/legacyclientimages/{client_id}

Example Request

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": [
        {
            "imageArray": "test-image.png",
            "imageObject": "{}",
            "client": 12345
        }
    ]
}

Add an Image with a Tag

API Endpoint

http://p.lssdev.com/legacyclientimages/{client_id}/{tag}

Get all Images

API Endpoint

http://p.lssdev.com/legacyclientimages/{client_id}

Example Request

GET /legacyclientimages/12345 HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json

Example Response