Developer Api

SENDING DATA FROM CRM OR FIELD SUPPORT TOOL TO BLITZZ

Blitzz platform rest API reference

BLITZZ 1.0.4

1. Sending Data from CRM or Field Support tool to Blitzz

This documentation show how to quickly  create a Blitzz Inquiry by  sending data from a  CRM tool  (like ServiceMax, Job Management Tool, or any other custom built tool) and launching Blitzz to Leverage high end functionality for Instant communication, HD  video calls, tracking inquiries,  annotating  images, etc

Content Type:  Text,  numbers, metadata and  images can be sent to Blitzz in the background.

1.1 ANDROID Sample app

Integrate with your existing Android app in 5 minutes:

Simply add a few lines of code to your existing Android application to launch Blitzz, and send a Job Number. This example can be extended to send more information like Description, Assignee, Priority, Images, Metadata, etc.

Content providers: Content providers can help an application manage access to data stored by itself, stored by other apps, and provide a way to share data with other apps.

Learn more about content providers here :  https://developer.android.com/guide/topics/providers/content-providers.html

Using intents:

Intent intent = new Intent(Intent.ACTION_MAIN); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setComponent(new ComponentName("app.blitzz","app.blitzz.CreateInquiryActivity")); intent.putExtra("jobnumber",jobNo); //Job Number here startActivity(intent);

1.2 iOS Sample app

Integrate with your existing iOS App in 5 minutes:

Simply add a few lines of code to your existing application iOS to launch Blitzz, and send a Job Number. This example can be extended to send more information like Description, Assignee, Priority, Images, Metadata, etc.

Step1: Open file:Info.plist  
TIP: Text should to be sent using utf8 from source application.

<key>LSApplicationQueriesSchemes</key>
<
array>
<
string>CreateInquiryType</string>
</
array>

Step2: Add a button called “Create Blitzz Inquiry: and add this event for OnButtonClick()


let customURL = ("CreateInquiryType://?jobnumber=" + (self.jobNo.text!).addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)!
)
 if UIApplication.shared.canOpenURL(URL(string: customURL)!)
 {
 UIApplication.shared.open(URL(string: customURL)!, options: [:], completionHandler: nil)
 }
 else
 {
 print("No custom URL defined")
 }
 }

2. Pull data into your App using Blitzz REST API.

Blitzz REST API allows customers to integrate Blitzz into their existing applications and workflows. The API is modelled using standard REST API guideline.

2.1 Getting Started

Welcome to the BLITZZ platform REST API reference. You can use this REST API to build add-ons for BLITZZ, develop integrations between BLITZZ and other applications, or script interactions with BLITZZ. This page documents the REST resources available in BLITZZ platform, along with expected HTTP response codes and sample requests.

2.1.1 URI Structure

BLITZZ REST APIs provide access to resources (data entities) via URI paths. To use a REST API, your application will make an HTTP request and parse the response. The BLITZZ REST API uses JSON as its communication format, and the standard HTTP methods like GET, PUT, POST and DELETE (see API descriptions below for which methods are available for each resource). URIs for BLITZZ REST API resource have the following structure:  

http://api.blitzz.co/resource-name

2.1.2 API Key

To access the API, users need to get an API key from Blitzz. With the API key, user can request an authentication token using Username and Password.

PleaseLoginto get your Blitzz API Key.

2.1.3 Authentication – Get Authentication Token

Authentication Token is used to verify the API key, UserID (email), password and returns an authentication token for all subsequent API calls.

Method:POST

URL /getToken

Data Parameters

Parameter

Required

Type

Sample Value

APIKEY

YES

Varchar

Yter70vbdIKhtv6mak

EMAIL

YES(a valid email)

Varchar

jon@blitzz.co

PASSWORD

YES(min 8 char)

varchar

password

Response:
Response has 200 HTTP STATUS CODE for all requests.
Success response has success key value as 1. All others are considered as Failed.

Response:  Success


{"success":1,
"data":{"Token":"cd0cfc7280a760b6b5ff1a7cc6edae3950572b86",
 "EMAIL":"jon@blitzz.co",
 "FName":"Jon",
 "LName":"Smith",
 "PROFILEPIC":"",
 "UID":1,
 "PCODE":"1",
 "PNO":"123456789"
}}
 

Response:  Fail

Failed responses have the same format throughout the application as below, with relevant ERRORCODE


{"success":0,
"data":{"ERRORCODE":101,
 "ERROR":"User does not exist",
 "TITLE":"Error"
}}
 

2.2 Users

There are different types of user roles in Blitzz. For example, Support reps are users who provide help/expertise to other users, and regular end users. Users can be invited using Invite User method, or added using the Add User method.

2.2.1 Invite User

Only Admin users can invite another user to join Blitzz. Once invited, the user would receive an email with instructions to create an account. Users can also download the app and register for a new account.

URL /user/invite

Method: POST

URL Parameters

None

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Data Parameters

Parameter

Required

Type

Sample Value

EMAIL

YES(a valid email)

Varchar

jon@blitzz.co

ROLECODE*

YES

varchar

ADMIN

*ROLECODE must be ADMIN, REP, CUSTOMER.

Please contact us if you would like to enable more roles and permissions.

Response


 {"success":1,
"data":{"EMAIL":"jon@blitzz.co",
 "ROLECODE":"ADMIN"
}}
 

2.2.2 Add User

Only Admin users can create another user to join Blitzz. Once created, the user will not receive an email with instructions to login or create an account (unlike Invite Users in the earlier section). Add User creates a new user account with specified details. The request can contain all, some or none of the optional parameters.

Please note that trailing whitespaces in string data (except password) will be trimmed.

URL /user

Method: POST

URL Parameters

None

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Content-Type

multipart/form-data

Data Parameters

Parameter

Required

Type

Sample Value

EMAIL*

YES(a valid email)

Varchar

jon@blitzz.co

PASSWORD

YES(min 8 char)

varchar

password

FNAME

YES

varchar

Jon

LNAME

YES

varchar

Smith

PCODE

NO

varchar

1

PNO

NO

varchar

4088403318

PROFILEPIC

NO

image-data

* Only login OR email required

Response


{"success":1,
"data":{"EMAIL":"jon@blitzz.co",
 "F

Name":"Jon",
 "LName":"Smith",
 "PROFILEPIC":"",
 "UID":1,
 "PCODE":"1",
 "PNO":"123456789"
}}
 

2.2.3 Get User List

Returns list of all users as per query criteria for a specific company.


 /user?query={query}&skip=&limit=

Method: GET

URL Parameters

Parameter

Required

Type

Sample Value

QUERY

NO

Varchar

E.g. Jon

[Search for users by First or Last name]

SKIP

NO

Number

50
[Default is 0]

LIMIT

NO

Number

50
[Default is 100]
[Max is 100]

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Response


{"success":1,
"data":{"Users":[
{"EMAIL":"Jon@blitzz.co",
 "FName":"Jon",
 "LName":"Smith",
 "PROFILEPIC":"",
 "UID":75,
 "PCODE":"1",
 "PNO":"4082334422"
},
{"EMAIL":"jmitchell@blitzz.co",
 "FName":"Mitchell",
 "LName":"Jonny",
 "PROFILEPIC":"",
 "UID":465,
 "PCODE":"1",
 "PNO":"2693321234"
}
]
}}
 

2.2.4 Get User Details

Returns details of the specified user.

URL /user/{UID}

Method :GET

URL Parameters

Parameter

Required

Type

Sample Value

UID

YES

Number

465

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Response

 
 {"success":1,
"data":{"EMAIL":"jmitchell@blitzz.co",
 "FName":"Michell",
 "LName":"Jonny",
 "PROFILEPIC":"",
 "UID":465,
 "PCODE":"1",
 "PNO":"2693321234"
}}
 

2.2.5 Update User

Update details for currently logged in user.

URL /user/edit

Method :POST

URL Parameters

None

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Content-Type

multipart/form-data

Data Parameters

Parameter

Required

Type

Sample Value

FNAME

YES

varchar

Jon

LNAME

YES

varchar

Smith

PCODE

NO

varchar

1

PNO

NO

varchar

89754622

PROFILEPIC

NO

image-data

Response

 
{"success":1,
"data":{"EMAIL":"jon@blitzz.co",
 "FName":"Jon",
 "LName":"Smith",
 "PROFILEPIC":"",
 "UID":1,
 "PCODE":"1",
 "PNO":"123456789"
}} 

2.2.6 Deactivate user

Deactivate specified user. Only Admin role users can deactivate a user.

URL /user/{UID}

Method: PUT

URL Parameters

Parameter

Required

Type

Sample Value

UID

YES

Number

106

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Data Parameters

None

Response

 

{
"success":1,
"data": null
} 


2.3 Inquiry

An interaction between a user (internal employee, subcontractor, or external customer) and a support rep is initiated by creating an Inquiry. Every Inquiry is recorded and can be answered by a rep using text, audio or video file.

2.3.1 Create New Inquiry

This function creates a new Inquiry. An Inquiry is initiated by or on behalf of a user and is sent to the entire support team or to specific reps based on custom workflows.

URL /inquiry

Method: POST

URL Parameters

None

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Content-Type

multipart/form-data

Data Parameters

Parameter

Required

Type

Sample Value

TITLE

YES(a valid email)

Varchar

INQUIRY 1

DESCRIPTION

NO

varchar

Sample description

CONTACTLIST

NO

Arrayof int

[14,112,14]

GROUPLIST

NO

Arrayof int

[4,12,34]

PRIORITYID

NO

number

2

INQIMAGE

NO

image-data

Response

 
 {
 "success": 1,
 "data": {
 "QBID": "584faa47700062",
 "IID": 9647,
 "OccupantsList": [
 {
 "QBID": 282704,
 "UCID": 696,
 "FULLNAME": "Mitchell Jonny",
 "PROFILEPIC": "636132915853369958.jpg",
 "ROLECODE": "ADM",
 "ROLEDISPLAY": "ADMIN",&
lt;!-- [et_pb_line_break_holder] --> },{
 "QBID": 21558,
 "UCID": 70203,
 "FULLNAME": "Jon Smith",
 "PROFILEPIC": null,
 "ROLECODE": "ADM",
 "ROLEDISPLAY": "ADMIN",
 
 }
 ]
 }
}


 

2.3.2 Get Inquiry List

Returns list of Inquiries as per query criteria.

URL /inquiry?query={query}&skip=&limit=

Method: GET

URL Parameters

Parameter

Required

Type

Sample Value

QUERY

NO

Varchar

E.g. part of {inquiry_title}
[This will help in searching an inquiry by its title]

SKIP

NO

Number

50
[Default is 0]

LIMIT

NO

Number

50
[Default is 100]
[Max is 100]

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Response

 
 {"success":1,
 "data":{"inquirylist":[
 {
 "IID":42978,
 "QBID":"5934e64c471091d",
 "TITLE":"INQ 1",
 "IMAGE":"636227933604284181.jpg",
 "STATUSCODE":"ACT",
 "TYPE":2,
 "CREATEDBY":20196,
 "last_message":"USER 2: Message”,
 "last_message_date_sent":"2017-07-08 11:31:06 PM",
 "last_message_QB_user_id":"233352",
 "Last_message_user_name":"",
 "Unreadcount":0,
 "Isunread":false,
 "Epochtimestamp":1499556666,
 "IPID":null,
 "COLOR":null,
 "NAME":null,
 "PRIORITYID":0,
 "HASEXTERNAL":false,
 "OCCUPANTSLIST":[]
 },
{
 "IID":42978,
 "QBID":"5934e642031091d",
 "TITLE":"INQ TITLE",
 "IMAGE":"636227933604284181.jpg",
 "STATUSCODE":"ACT",
 "TYPE":2,
 "CREATEDBY":20196,
 "last_message":"USR 4: Message”,
 "last_message_date_sent":"2017-07-08 11:31:06 PM",
 "last_message_QB_user_id":"25352",
 "Last_message_user_name":"",
 "Unreadcount":0,
 "Isunread":false,
 "Epochtimestamp":1499556666,
 "IPID":null,
 "COLOR":null,
 "NAME":null,
 "PRIORITYID":0,
 "HASEXTERNAL":false,
 "OCCUPANTSLIST":[]
},
}]
}}
 

2.3.3 Get Inquiry Details

Returns details of the specified Inquiry.

URL /Inquiry/{Inquiry id}

Method: GET

URL Parameters

Parameter

Required

Type

Sample Value

IID

YES

Number

100667

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Response

 
{
 "success": 1,
 "data": {
 "IId": 100667,
 "TITLE": "Test123456",
 "CDATETIME": "14-12-2016 10:34:27 AM",
 "CREATEDBY": 70202,
 "STATUSCODE": "ACT",
 "LSMDATETIME": "14-12-2016 10:34:27 AM",
 "IMAGE": null,
 "DESCRIPTION": "inq desc",
 "QBID": "585181bb000061",
 "ATTACHMENTTYPE": 1,
 "STATUSDISPLAYNAME": "Active",
 "totalparticipants": 2,
 "onlineparticipants": 2,
 "CREATOR": {
 "QBID": 21525843,
 "UCID": 70202,
 "FULLNAME": "Jon Smith",
 "PROFILEPIC": null,
 "ROLECODE": "ADM",
 "ROLEDISPLAY": "ADMIN",
 "CHATID": null,
 "QBDIALOGID": null,
 },
 "participants": [
 {
 "QBID": 2158,
 "UCID": 70203,
 "FULLNAME": "Mad Max",
 "PROFILEPIC": null,
 "ROLECODE": "EXT",
 "ROLEDISPLAY": "EXTERNAL",
 "CHATID": null,
 "QBDIALOGID": null,
 "ONLINESTATUS": "ONLINE"
 }
 ],
 "groups": [
 {
 "GID": 12,
 "NAME": "Welcome to ACME",
 "DESCRIPTION": "Document Description for ACME company",
 "GPHOTO": null,
 "GTHUMBPHOTO": null,
 "COMPANYID": 1,
 "CNAME": "ACME company Name",
 "CREATEDBYDATETIME": "12-12-2016 07:00:26 AM",
 "CREATEDBYUCID": 60196,
 "CREATEDBYNAME": "Mad Max",
 "ISDEFAULTGROUP": true,
 "MEMBERSCOUNT": 4,
 "ISMEMBER": true,
 "IID": 100667,
 "QBID": "58511ff81bb000061",
 "MEMBERLIST": []
 }],
"PRIORITYPERMISSION": true,
"PRIORITYLIST": [
 {
 "PRIORITYID": 2,
 "NAME": "High",
 "COMPANYID": 1,
 "CREATEDBYUCID": 70202,
 "CREATEDDATE": "05-01-2017 06:55:41 AM",
 "COLOR": "#fce5cd",
 "ISSELECTED": false
 }
]
 }
}
 

2.3.4 Edit or Update an Inquiry

Update specified Inquiry. This service can also be used to assign Inquiry to a specific rep or to update Inquiry status (eg. Resolved / Archived) and to change the Inquiry Priority.

URL /Inquiry/edit/{Inquiry id}

Method: POST

URL Parameters

Parameter

Required

Type

Sample Value

IID

YES

Number

1

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Data Parameters

Parameter

Required

Type

Sample Value

TITLE

YES(a valid email)

Varchar

Job# 2234

DESCRIPTION

NO

varchar

Sample description

Response

 
{
{
 "success": 1,
 "data": null
}


 

2.3.5 Archive / Un-Archive Inquiry

Update specified Inquiry.

URL /Inquiry/{Inquiry id}/{status}

Method: PUT

URL Parameters

Parameter

Required

Type

Sample Value

IID

YES

Number

1

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Response

 
{
 "success": 1,
 "data": null
}


 

2.4 Document Library

Library of documents available to reps and customers through Blitzz. Documents can be FAQs, user manuals, products and videos.
Supported file formats: Excel, Doc, PPT, PDF
Max upload size: 25 MB (This is a default limit, and can be increased or decreased)

2.4.1 Add Document

Upload a new document to library.

URL /document

Method: PUT

URL Parameters

None

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Content-Type

multipart/form-data

Data Parameters

Parameter

Required

Type

Sample Value

TITLE

YES(a valid email)

Varchar

My Document

DESCRIPTION

NO

varchar

This is my first document

CONTACTLIST

NO

Arrayof int

[14,112,14]

GROUPLIST

NO

Arrayof int

[4,12,34]

DOCTYPE*

YES

varchar

Excel

DOCEXTENSION

YES

varchar

xlsx

Response

 
{
 "success":1,
 "Data":{
 "RESULT":1,
 "DOCID":30034,
 "PERMISSION":{
 "PERMISSIONID":1,
 "DOCID":30034,
 "TITLE":"Doc 6",
 "DOCNAME":"636195651541481915.xlsx",
 "DOCEXTENSION":".xlsx",
 "DOCTYPE":"excel",
 "DESCRIPTION":"thanks",
 "DOCSIZE":&q
uot;12KB",
 "USERLIST":[
 {
 "UCID":40176,
 "QBID":17669876
 },
 {
 "UCID":40177,
 "QBID":17669978
 },
 {
 "UCID":50193,
 "QBID":18337720
 },
 {
 "UCID":60196,
 "QBID":21482704
 },
 {
 "UCID":70198,
 "QBID":21483232
 },
 {
 "UCID":70199,
 "QBID":21518363
 },
 {
 "UCID":70201,
 "QBID":21518389
 },
 {
 "UCID":70202,
 "QBID":21525843
 },
 {
 "UCID":70203,
 "QBID":21525858
 }
 ]
 } 

2.4.2 Get Document List

Returns list of documents as per query criteria.

URL /document?query={query}&skip=&limit=

Method :GET

URL Parameters

Parameter

Required

Type

Sample Value

QUERY

NO

Varchar

tes [Search for a document by its name]

SKIP

NO

Number

50
[Default is 0]

LIMIT

NO

Number

50
[Default is 100]
[Max is 100]

Headers

Token

“cd0cfc7280a760b6b5ff1a7cc6edae3950572b86”

Data Parameters

Parameter

Required

Type

Sample Value

TITLE

YES(a valid email)

Varchar

My Document

DESCRIPTION

NO

varchar

This is my first document

CONTACTLIST

NO

Arrayof int

[14,112,14]

GROUPLIST

NO

Arrayof int

[4,12,34]

DOCTYPE*

YES

varchar

Excel

DOCEXTENSION

YES

varchar

xlsx

 
{
 "success": 1,
 "data": {
 "MyDocumentList": [
 {
 "DOCID": 10016,
 "CREATEDDATE": "29-12-2016 05:20:35 AM",
 "CREATEBYUCID": 70202,
 "CREATEDBYNAME": "USER 2",
 "CREATEDBYEMAIL": "user2@gmail.com",
 "CREATEDBYPROFILEPIC": null,
 "TITLE": "Test Document for Blitzz”,
 "DESCRIPTION": "Doc description",
 "DOCNAME": "636186054347458777.docx",
 "DOCEXTENSION": ".docx",
 "DOCSIZE": "11.1504 KB",
 "DOCTYPE": "word",
 "SHAREDWITHTEXT": "4 Members",
 "PERMISSIONID": 0,
 "SHAREDBYNAME": null,
 "SHAREDBYEMAIL": null,
 "SHAREDBYPROFILEPIC": null,
 "SHAREDTIME": "01-01-0001 12:00:00 AM",
 "SHAREDLIST": [
 {
 "FULLNAME": "r4 r4"
 },
 {
 "FULLNAME": "User 22"
 },
 {
 "FULLNAME": "User 23"
 },
 {
 "FULLNAME": "User 24"
 }
 ]
 }],
 "SharedDocumentList": [
 {
 "DOCID": 10017,
 "CREATEDDATE": "29-12-2016 05:20:35 AM",
 "CREATEBYUCID": 70203,
 "CREATEDBYNAME": "USER 5",
 "CREATEDBYEMAIL": "user5@gmail.com",
 "CREATEDBYPROFILEPIC": null,
 "TITLE": "Doc 5",
 "DESCRIPTION": "doc desc",
 "DOCNAME": "636186065544209194.xls",
 "DOCEXTENSION": ".xls",
 "DOCSIZE": "25.5 KB",
 "DOCTYPE": "excel",
 "SHAREDWITHTEXT": null,
 "PERMISSIONID": 1,
 "SHAREDBYNAME": "user 6",
 "SHAREDBYEMAIL": "user6@gmail.com",
 "SHAREDBYPROFILEPIC": null,
 "SHAREDTIME": "29-12-2016 05:39:14 AM",
 "SHAREDLIST": []
 }]
 }
}

3. Error Codes and Their Meanings

101

Invalid User - User does not exist

400

Bad Request – Your request has an incorrect parameter

401

Unauthorized – Your Blitzz-Application-Id header is incorrect

403

Forbidden – You accessed a resource not allowed with your key

404

Not Found – The specified resource could not be found

405

Method Not Allowed – You tried to access a resource with an invalid HTTP method

406

Not Acceptable – You requested a format that is not JSON format, Blitzz API supports JSON

410

Gone – The resource requested has been removed from our servers

500

Internal Server Error – We had a problem with our server. Please contact us (support@blitzz.co)