Difference between revisions of "Add Customer"

From MyMobileWorkers API
Jump to: navigation, search
(Created page with "== Summary == {| border="1" class="wikitable" ! Add Customer ! colspan="2" | |- ! URL | colspan="2" | http://base_url/api_path/version/companies/company/customers/customer ...")
 
Line 43: Line 43:
 
! Required
 
! Required
 
|-
 
|-
−
! job_number
+
! contact_name
 
| varchar(45) <br /><span style="font-size:80%; font-weight:normal">* must be unique</span>|| &#10003;
 
| varchar(45) <br /><span style="font-size:80%; font-weight:normal">* must be unique</span>|| &#10003;
 +
|-
 +
! name
 +
| varchar(255) ||
 
|-
 
|-
 
! address_1
 
! address_1
−
| varchar(45) || &#10003;
+
| varchar(45) ||
 
|-  
 
|-  
 
! address_2
 
! address_2
Line 56: Line 59:
 
|-  
 
|-  
 
! address_4
 
! address_4
 +
| varchar(45) ||
 +
|-
 +
! postcode
 +
| varchar(45) ||
 +
|-
 +
! contact_number
 
| varchar(45) ||  
 
| varchar(45) ||  
 
|-  
 
|-  

Revision as of 10:39, 22 May 2013

Contents

Summary

Add Customer
URL http://base_url/api_path/version/companies/company/customers/customer
Type POST
Params: api_key required
file required
Response JSON


5 contact_name 6 address_1 7 address_2 8 address_3 9 address_4 10 postcode 11 contact_number

The add customer action allows users to attach a customer to their company.

JSON Parameters

The JSON file is passed in the post as the "file"
Standard Fields
Field Expected Data Required
contact_name varchar(45)
* must be unique
✓
name varchar(255)
address_1 varchar(45)
address_2 varchar(45)
address_3 varchar(45)
address_4 varchar(45)
postcode varchar(45)
contact_number varchar(45)

Example JSON

{

  "customers":[
     {
        "name":"LeeLand",
        "contact_name":"Mark Moose",
        "address_1":"1 the street",
        "postcode":"WA12 0JQ",
        "contact_number":"01942295900"
     }
  ]

}

Example curl request

curl -F validate_only=false -F update_existing=true -F api_key=YOURKEY -F file=@/Users/lee_orritt/Desktop/webAPICurling/create_customer.txt http://test.mymobileworkers.com:8080/api/1/companies/company/customers/customer

Responses

Example JSON

{"file":"tick.png","comment":"Transferred from API","created_at":"2013-05-20T14:42:37+00:00"}
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox