Developer API

Methods

1. Add Customer

Adds a customer to your business.

Request

Method URL
GET http://localfeedbackloop.com/api/addcustomer
Type Params Values
GET api_key string
GET first_name string
GET last_name string
GET customer_id string
GET email string
GET cell_phone int
GET employee_first string
GET employee_last string

api_key
api_key must be sent with all client requests. The api_key is generated in the system under the Setup -> Integrations tab.

first_name
first_name must be sent with all client requests. First name of customer being added.

last_name [optional]
last_name Last name of customer being added.

customer_id
customer_id must be sent with all client requests. Unique customer identifier specified by you. This is how results are grouped when retrieving data.

email [partially optional]
email OR cell_phone must be sent with all client requests. This is the email address of the customer.

cell_phone [partially optional]
cell_phone OR email must be sent with all client requests. This is the cell phone of the customer. Please do not include special characters (i.e. parenthesis, plus signs, or hyphens).

employee_first [optional]
employee_first is the first name of the employee the customer worked with. If an employee is specified that does not exist for the business, it will error.

employee_last [optional]
employee_last is the last name of the employee the customer worked with. If an employee is specified that does not exist for the business, it will error.

Response

Status Response
200 {
"success": 1
}
400 {"error":"Missing required fields. Required fields are api_key, first_name, customer_id and (email or cell_phone)."}
401 {"error":"Invalid API Key."}
401 {"error":"Incorrect username or password."}
500 {"error":"Business not found."}
500 {"error":"Membership not found."}
500 {"error":"Employee ‘<first_name> <last_name>’ not found in system."}
503 {"error":"Allowed business customer count exceeded."}

2. Retrieve Customer

Retrieves customer information and feedback.

Request

Method URL
GET http://localfeedbackloop.com/api/retrievecustomer
Type Params Values
GET api_key string
GET customer_id string
GET return_flag string

api_key
api_key must be sent with all client requests. The api_key is generated in the system under the Setup -> Integrations tab.

customer_id [optional]
The customer identifier of whom you are getting data for. If customer_id is omitted, all customers under the business will be returned.

return_flag [optional]
Acceptable values are ‘all_feedback’. If set to ‘all_feedback’, it returns all feedback for the customer specified. If omitted, it will return the latest feedback for the customer specified. If no customer is specified, it returns all customers for the business including all of the feedback or latest feedback depending on what this is set to.

Response

Status Response
200
   "success": "1",
   "customer_data": [
    {
      "<unique_customer_id>": {
           "customer_name": "Jeff",
           "customer_last_name": "Goldblum",
           "customer_email": "bestactorever@imdb.com",
           "date_of_submission": "2016-02-01 12:31:34",
           "description": "Awesome work guys!",
           "cell_phone": "8765559876",
           "address": "123 Scenic Way",
           "city": "Beverly Hills",
           "state": "California",
           "zip": "90210",
           "rating": "5"
         }
     }
  ]
}
If customer_id is specified
{
   "success": "1",
   "customer_data": [
       {
           "customer_name": "Jeff",
           "customer_last_name": "Goldblum",
           "customer_email": "bestactorever@imdb.com",
           "date_of_submission": "2016-02-01 12:31:34",
           "description": "Awesome work guys!",
           "cell_phone": "8765559876",
           "address": "123 Scenic Way",
           "city": "Beverly Hills",
           "state": "California",
           "zip": "90210",
           "rating": "5"
       }
   ]
}
400 {"error":"Missing required fields. Required fields are api_key."}
401 {"error":"Invalid API Key."}

Response will be an object containing customer information and feedback based on params specified. If customer_id is not specified

Glossary

Conventions

  • Client – Client application.
  • Status – HTTP status code of response.
  • All response are in JSON format.
  • All request parameters are mandatory unless explicitly marked as [optional]
  • The type of values accepted for a request parameter are shown the the values column like this [10|<any number>] .The | symbol means OR. If the parameter is [optional], the default value is shown in blue bold text, as 10 is written in [10|<any number>].

Status Codes

All status codes are standard HTTP status codes. The below ones are used in this API.

2XX – Success of some kind
4XX – Error occurred in client’s part
5XX – Error occurred in server’s part

Status Code Description
200 OK
400 Bad request
401 Authentication failure
403 Forbidden
404 Resource not found
405 Method Not Allowed
409 Conflict
412 Precondition Failed
413 Request Entity Too Large
500 Internal Server Error
501 Not Implemented
503 Service Unavailable