BCR Export Protocol SHAPE 2012 Business Card Reader sends HTTP POST multipart request optional HTTP authentication is supported, BASIC and DIGEST methods with the following parameters: command - Action performed with business card. Possible values: add, edit, delete. personfirstname - string with contact first name personmiddlename - string with contact middle name personlastname - string with contact last name phoneticfirstname - string with contact phonetic first name phoneticlastname - string with contact phonetic last name prefix - string with contact name prefix suffix - string with contact name suffix nickname - string with contact nickname companyname - string with contact company name job - string with contact job title department - string with contact department title notes - string with contact notes birthday - string with birth date in unix time phones - array of arrays with phone strings [phones] => Array [mobile] => Array [0] => 0123654789 [0] => 0123546879 emails - array of arrays with email strings [emails] => Array [0] => sales@company.com urls - array of arrays with with url strings [urls] => Array
[0] => www.company.com otherinfo - array of strings. Contains whole recognized text in first element. Some other strings could be added later. [otherinfo] => Array [0] => SAMPLE COMPANY National Park 32415 phone 01 236 5478 mobile 0123 54687 email sales@company.conn website www.company.com JOHN SMITH addresses - array of address dictionaries with keys country, city, zip, street. [addresses] => Array [zip] => 32415 [country] => United States [street] => National Park ims - array of instant messenger dictionaries with keys service, user. [ims] => Array [service] => ICQ [user] => 123456789 sns - array of social network dictionaries with keys service, user. [sns] => Array [service] => facebook
[user] => JohnSmith dates - array of date dictionaries with keys label, date. Date is sent in unix time format. [dates] => Array [label] => Anniversary [date] => 1332321433 All parameters are UTF8-encoded. Image with photo of business card is sent as binary data in the last parameter with following header: [Content-Disposition: form-data; name="photo"; filename="photo.jpg ] [Content-Type: image/jpeg] Business Card Reader expects answer to this request with status code 200. Example HTTP request POST /test.php HTTP/1.1 Host: bcrtest.shapeservices.net User-Agent: BCR/2.2 CFNetwork/548.0.3 Darwin/10.7.0 Content-Length: 36565 Accept: */* Content-Type: multipart/form-data; boundary=---------------------------xao1xqci Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: keep-alive Content-Disposition: form-data; name="personfirstname" JOHN Content-Disposition: form-data; name="personlastname" SMITH Content-Disposition: form-data; name="companyname" Sample Company Content-Disposition: form-data; name="otherinfo[0]" SAMPLE COMPANY National Park 32415
phone 01 236 5478 mobile 0123 54687 email sales@company.conn website www.company.com JOHN SMITH Content-Disposition: form-data; name="addresses[0][zip]" 32415 Content-Disposition: form-data; name="addresses[0][country]" United States Content-Disposition: form-data; name="addresses[0][street]" National Park Content-Disposition: form-data; name="phones[mobile][0]" 012365478 Content-Disposition: form-data; name="phones[work][0]" 012354687 Content-Disposition: form-data; name="emails[work][0]" sales@company.conn Content-Disposition: form-data; name="urls[work][0]" www.company.com Content-Disposition: form-data; name="job" Content-Disposition: form-data; name="command" edit Content-Disposition: form-data; name="photo"; filename="photo.jpg" Content-Type: image/jpeg [[***BINARY DATA***]] -- Results in PHP $_FILES: [photo] => Array [name] => photo.jpg
[type] => image/jpeg [tmp_name] => /tmp/phpo54rnj [error] => 0 [size] => 0 $_POST [personfirstname] => JOHN [personlastname] => SMITH [companyname] => Sample Company [otherinfo] => Array [0] => SAMPLE COMPANY National Park 32415 phone 01 236 5478 mobile 0123 54687 email sales@company.conn website www.company.com JOHN SMITH [addresses] => Array [zip] => 32415 [country] => United States [street] => National Park [phones] => Array [mobile] => Array [0] => 012365478 [0] => 012354687 [emails] => Array
[0] => sales@company.conn [urls] => Array [0] => www.company.com [job] => [command] => edit