Vous êtes sur la page 1sur 43

BYF Dental API

Date: October 1, 2015

2526 Qume Dr. Ste. 15, San Jose,


CA 95131
Tel (800) 361-1659
Fax (408) 273-6696
https://www.byfdental.com

Table of Contents
1. Overview ..............................................................................................................................2
2. Technology...........................................................................................................................2
3. Functional Overview ..........................................................................................................2
3.1 All Operations ...............................................................................................................2
3.2 Operation Specifications .............................................................................................4
3.2.1 GeLatest10Accounts ..........................................................................................4
3.2.2 GeAccountsByPaging ........................................................................................5
3.2.3 GetAccountById ..................................................................................................6
3.2.4 CreateAccount .....................................................................................................7
3.2.5 UpdateAccount ...................................................................................................8
3.2.6 DeleteAccount .....................................................................................................9
3.2.7 GetLatest10CaseOrders..................................................................................10
3.2.8 GeCaseOrdersByPaging ..................................................................................11
3.2.9 GeCaseOrderById .............................................................................................12
3.2.10 CreateCaseOrder............................................................................................13
3.2.11 UpdateCaseOrder ..........................................................................................14
3.2.12 DeleteCaseOrder ............................................................................................15
3.2.13 GetLatest10CaseInvoices ............................................................................16
3.2.14 GeCaseInvoicesByPaging .............................................................................16
3.2.16 CreateCaseInvoice .........................................................................................19
3.2.17 UpdateCaseInvoice ........................................................................................21
3.2.18 DeleteCaseInvoice .........................................................................................23
3.2.19 GetLatest10CaseInvoiceItems....................................................................24
3.2.20 GeCaseInvoiceItemsByPaging ....................................................................25
3.2.21 GetCaseInvoiceItemById ............................................................................26
3.2.22 CreateCaseInvoiceItem ................................................................................27
3.2.23 UpdateCaseInvoiceItem ...............................................................................28
3.2.24 DeleteCaseInvoiceItem ................................................................................29
3.2.25 GetLatest10CaseIssues.................................................................................30
3.2.26 GeCaseIssuesByPaging .................................................................................31
3.2.27 GetCaseIssueById .........................................................................................32
3.2.28 CreateCaseIssue .............................................................................................33
3.2.29 UpdateCaseIssue ............................................................................................34
3.2.30 DeleteCaseIssue .............................................................................................35
3.2.31 GetLatest10RMAs ..........................................................................................36
3.2.32 GetRMAsByPaging .........................................................................................37
3.2.33 GetRMAById ...................................................................................................38
3.2.34 CreateRMA .......................................................................................................39

BYF Dental. All rights reserved

Page 1

3.2.45 UpdateRMA .....................................................................................................40


3.2.36 DeleteRMA .......................................................................................................41
3.3 Error Code and Error Message .................................................................................42
3.3.1 Error Code and Error Message .....................................................................42

1. Overview
This document describes the BYF Dental API. The API is designed to allow external
applications to interface with the BYF Dental MS Dynamic CRM system. Client
Applications can request for any operation defined in the API service.
Service Url: http://<APIUrl>/api

2. Technology
The API is implemented as a Secure Web API Service. It will be accessible via the
Internet over HTTP or HTTPS/SSL only.
Security API user's are validated using their assigned username and password.

3. Functional Overview
3.1 All Operations
The API supports the following distinct data records for consumption:
Name
GetLatest10Accounts
GetAccountsByPaging
GetAccountById
CreateAccount
UpdateAccount
DeleteAccount
GetLatest10CaseOrders
GetCaseOrdersByPaging
GetCaseOrderById
CreateCaseOrder
UpdateCaseOrder
DeleteCaseOrder
GetLatest10CaseInvoices
GetCaseInvoicesByPaging
GetCaseInvoiceById
CreateCaseInvoice
UpdateCaseInvoice
DeleteCaseInvoice

Description
Returns a list of account records
Returns a list of account records
Returns an account record
Create a new account record
Update an account record
Delete an account record
Returns a list of case orders
Returns a list of case order records
Returns a case order record
Create a new case order record
Update a case order record
Delete a case order record
Returns a list of case invoices
Returns a list of case invoice records
Returns a case invoice record
Create a new case invoice record
Update a case invoice record
Delete a case invoice record

BYF Dental. All rights reserved

Page 2

GetLatest10CaseInvoiceItems
GetCaseInvoiceItemsByPaging
GetCaseInvoiceItemById
CreateCaseInvoiceItem
UpdateCaseInvoiceItem
DeleteCaseInvoiceItem
GetLatest10CaseIssues
GetCaseIssuesByPaging
GetCaseIssueById
CreateCaseIssue
UpdateCaseIssue
DeleteCaseIssue
GetLatest10RMAs
GetRMAsByPaging
GetRMAById
CreateRMA
UpdateRMA
DeleteRMA

Returns a list of case invoice items


Returns a list of case invoice items
Returns a case invoice item record
Create a new case invoice item record
Update a case invoice item record
Delete a case invoice item record
Returns a list of case issues
Returns a list of case issue records
Returns a case issue record
Create a new case issue record
Update a case issue record
Delete a case issue record
Returns a list of rma records
Returns a list of rma records
Returns a rma record
Create a new rma record
Update a rma record
Delete a rma record

BYF Dental. All rights reserved

Page 3

3.2 Operation Specifications


3.2.1 GeLatest10Accounts
Description:
This will return a list of all Dynamics CRM account records.
Request Url:
http://52.89.207.54/api/accounts
Request Parameters:
Name
X-ApiUsername
X-ApiPassword

Type
string
string

Description
Api username
Password

Response:
A list of dynamics crm account records in json format.
[{"Id":"023edab2-0558-e511-80e4-3863bb3c1190","Name":"Le, Katrina,
DDS","CompanyName":null,"Telephone1":"(650) 9691774","Fax":null,"EmailAddress1":"t.le.dds@gmail.com","PrimaryContact":null,"Address1_Lin
e1":"777 Coesta Dr. #130","Address1_City":"Mountain
View","Address1_StateOrProvince":"CA","Address1_PostalCode":"94040","createdon":
"9/10/2015 12:53:39 AM","modifiedon": "10/23/2015 8:37:55 PM"},{"Id":"b711f51f-4957-e51180e4-3863bb3c1190","Name":"Marina Park Dental","CompanyName":"Marina Park
Dental","Telephone1":"(415) 5631600","Fax":null,"EmailAddress1":"sf@marinaparkdental.com","PrimaryContact":null,"Address
1_Line1":"2001 Union St. #385","Address1_City":"San
Francisco","Address1_StateOrProvince":"CA","Address1_PostalCode":"94123","createdon":
"9/10/2015 12:53:39 AM","modifiedon": "10/23/2015 8:37:55 PM"}]

Javascript Code Sample:


The following Javascript code shows how to call GetLatest10Accounts:
function GetLatest10Accounts() {
$.ajax({
url: 'http://52.89.207.54/api/accounts',
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function(data, status, xhr){
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}

BYF Dental. All rights reserved

Page 4

3.2.2 GeAccountsByPaging
Description:
This will return a list of Dynamics CRM account records based on page size, page
number and sort expression.
Request Url:
http://52.89.207.54/api/accounts/1/10/createdon
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
PageNumber
PageSize
SortBy

Type
string
string
int
int
string

Description
Api username
Password
Page number.
Page size
Sort by param

Response:
A list of dynamics crm account records in json format.
[{"Id":"023edab2-0558-e511-80e4-3863bb3c1190","Name":"Le, Katrina,
DDS","CompanyName":null,"Telephone1":"(650) 9691774","Fax":null,"EmailAddress1":"t.le.dds@gmail.com","PrimaryContact":null,"Address1_Lin
e1":"777 Coesta Dr. #130","Address1_City":"Mountain
View","Address1_StateOrProvince":"CA","Address1_PostalCode":"94040","createdon":
"9/10/2015 12:53:39 AM","modifiedon": "10/23/2015 8:37:55 PM"},{"Id":"b711f51f-4957-e51180e4-3863bb3c1190","Name":"Marina Park Dental","CompanyName":"Marina Park
Dental","Telephone1":"(415) 5631600","Fax":null,"EmailAddress1":"sf@marinaparkdental.com","PrimaryContact":null,"Address
1_Line1":"2001 Union St. #385","Address1_City":"San
Francisco","Address1_StateOrProvince":"CA","Address1_PostalCode":"94123","createdon":
"9/10/2015 12:53:39 AM","modifiedon": "10/23/2015 8:37:55 PM"}]

Javascript Code Sample:


The following Javascript code shows how to call GetAccountsByPaging:
function GetAccountsByPaging() {
$.ajax({
url: 'http://52.89.207.54/api/accounts/1/10/createdon',
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function(data, status, xhr){
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}

BYF Dental. All rights reserved

Page 5

3.2.3 GetAccountById
Description:
This will return a Dynamics CRM account record.
Request Url:
http://52.89.207.54/api/accounts/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
AccountId (Guid)

Response:
A dynamics crm account record in json format.
{"Id":"023edab2-0558-e511-80e4-3863bb3c1190","Name":"Le, Katrina,
DDS","CompanyName":null,"Telephone1":"(650) 9691774","Fax":null,"EmailAddress1":"t.le.dds@gmail.com","PrimaryContact":null,"Address1_Lin
e1":"777 Coesta Dr. #130","Address1_City":"Mountain
View","Address1_StateOrProvince":"CA","Address1_PostalCode":"94040","createdon":
"9/10/2015 12:53:39 AM","modifiedon": "10/23/2015 8:37:55 PM"}

Javascript Code Sample:


The following Javascript code shows how to call GetAccountById:
function GetAccountById() {
var id = $('#txtId').val();
if (id != '') {
$.ajax({
url: 'http://52.89.207.54/api/accounts/' + id,
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
ShowAccount(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 6

3.2.4 CreateAccount
Description:
This will create a new account record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/accounts
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Account

Type
string
string
object

Description
Api username
Password
An account object

Response:
A dynamics crm account record in json format.
{"Name":"Le, Katrina, DDS","CompanyName":null,"Telephone1":"(650) 9691774","Fax":null,"EmailAddress1":"t.le.dds@gmail.com","PrimaryContact":"94040","Address1_
Line1":"777 Coesta Dr. #130","Address1_City":"Mountain
View","Address1_StateOrProvince":null,"Address1_PostalCode":null}

Javascript Code Sample:


The following Javascript code shows how to call CreateAccount:
function CreateAccount() {
var account = {
Name: 'DEV TEST',
CompanyName: 'API testCompany',
Telephone1: '8887776666',
EmailAddress1: 'dev@gmail.com',
PrimaryContact: 'Primary Contact',
Address1_Line1: '123 Avalon Drive',
Address1_City: 'Plano',
Address1_StateOrProvince: 'TX',
Address1_PostalCode: '75025'
};
$.ajax({
url: 'http://52.89.207.54/api/accounts',
type: 'POST',
data: JSON.stringify(account),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 7

3.2.5 UpdateAccount
Description:
This will update an account record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/accounts/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id
Account

Type
string
string
string
object

Description
Api username
Password
AccountId (guid)
An account object

Response:
A dynamics crm account record in json format.
{"Name":"Le, Katrina, DDS","CompanyName":null,"Telephone1":"(650) 9691774","Fax":null,"EmailAddress1":"t.le.dds@gmail.com","PrimaryContact":"94040","Address1_
Line1":"777 Coesta Dr. #130","Address1_City":"Mountain
View","Address1_StateOrProvince":null,"Address1_PostalCode":null}

Javascript Code Sample:


The following Javascript code shows how to call UpdateAccount:
function UpdateAccount() {
var id = $('#txtId').val()
var account = {
Name: 'DEV TEST1',
CompanyName: 'API testCompany1',
Telephone1: '8887776666',
EmailAddress1: 'dev@gmail.com',
PrimaryContact: 'Primary Contact',
Address1_Line1: '123 Avalon Drive',
Address1_City: 'Plano',
Address1_StateOrProvince: 'TX',
Address1_PostalCode: '75025'
};
$.ajax({
url: 'http://52.89.207.54/api/accounts/' + id,
type: 'PUT',
data: JSON.stringify(account),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 8

3.2.6 DeleteAccount
Description:
This will update an account record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/accounts/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
AccountId (guid)

Response:
HTTP response
Javascript Code Sample:
The following Javascript code shows how to call DeleteAccount:
function DeleteAccount() {
var id = $('#txtId').val()
if (id != '') {
$.ajax({
url: 'http://52.89.207.54/api/accounts/' + id,
type: 'DELETE',
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
WriteResponse(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 9

3.2.7 GetLatest10CaseOrders
Description:
This will return a list of all Dynamics CRM case order records.
Request Url:
http://52.89.207.54/api/caseorders
Request Parameters:
Name
X-ApiUsername
X-ApiPassword

Type
string
string

Description
Api username
Password

Response:
A list of dynamics crm case order records in json format.
[{"Id":"2b27e539-ee58-e511-80e43863bb3c1190","Name":null,"byf_caseorder":null,"byf_customer":{"Id":"4fc89135-a025-e51180fe-fc15b4283a2c","Name":"Patel, Neilesh, DDS" },
"ark_drinitials":null,"ark_listedduedate":"9/25/2015 7:00:00
AM","ark_prosthodontics":null,"byf_patientfullname":"Cynthia
Carter","ark_age":null,"ark_abutment":null,"byf_redo":"No","ark_turn_around_time":
null,"byf_entryon": "10/22/2015 7:00:00 AM", "byf_name": "X00000010","byf_casestatus":
"Action Required","byf_teethnumber": "U","byf_shade_list": "A1","createdon": "10/28/2015
10:10:31 AM","modifiedon": "10/28/2015 10:10:41 AM"},{"Id":"12dcd70f-ee58-e511-80e43863bb3c1190","Name":null,"byf_caseorder":null,"byf_customer":{"Id":"4fc89135-a025-e51180fe-fc15b4283a2c","Name":"Patel, Neilesh,
DDS"},"ark_drinitials":null,"ark_listedduedate":"9/25/2015 7:00:00
AM","ark_prosthodontics":null,"byf_patientfullname":"Cynthia
Carter","ark_age":null,"ark_abutment":null,"byf_redo":"No"ark_turn_around_time": null,
"byf_entryon": "10/22/2015 7:00:00 AM","byf_name": "X00000010","byf_casestatus": "Action
Required","byf_teethnumber": "U","byf_shade_list": "A1","createdon": "10/28/2015 10:10:31
AM","modifiedon": "10/28/2015 10:10:41 AM"}]

Javascript Code Sample:


The following Javascript code shows how to call GetLatest10CaseOrders:
function GetLatest10CaseOrders() {
$.ajax({
url: 'http://52.89.207.54/api/caseorders,
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
WriteResponse(data);
$.unblockUI();
},
error: function (xhr, textStatus, errorThrown) {
$.unblockUI();
alert(textStatus);
}
});
}

BYF Dental. All rights reserved

Page 10

3.2.8 GeCaseOrdersByPaging
Description:
This will return a list of Dynamics CRM case order records based on page size, page
number and sort expression.
Request Url:
http://52.89.207.54/api/caseorders/pageNumber/pageSize/sortBy
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
PageNumber
PageSize
SortBy

Type
string
string
int
int
string

Description
Api username
Password
Page number.
Page size
Sort by param

Response:
A list of dynamics crm case order records in json format.
[{"Id":"2b27e539-ee58-e511-80e43863bb3c1190","Name":null,"byf_caseorder":null,"byf_customer":{"Id":"4fc89135-a025-e51180fe-fc15b4283a2c","Name":"Patel, Neilesh, DDS" },
"ark_drinitials":null,"ark_listedduedate":"9/25/2015 7:00:00
AM","ark_prosthodontics":null,"byf_patientfullname":"Cynthia
Carter","ark_age":null,"ark_abutment":null,"byf_redo":"No","ark_turn_around_time":
null,"byf_entryon": "10/22/2015 7:00:00 AM", "byf_name": "X00000010","byf_casestatus":
"Action Required","byf_teethnumber": "U","byf_shade_list": "A1","createdon": "10/28/2015
10:10:31 AM","modifiedon": "10/28/2015 10:10:41 AM"},{"Id":"12dcd70f-ee58-e511-80e43863bb3c1190","Name":null,"byf_caseorder":null,"byf_customer":{"Id":"4fc89135-a025-e51180fe-fc15b4283a2c","Name":"Patel, Neilesh,
DDS"},"ark_drinitials":null,"ark_listedduedate":"9/25/2015 7:00:00
AM","ark_prosthodontics":null,"byf_patientfullname":"Cynthia
Carter","ark_age":null,"ark_abutment":null,"byf_redo":"No"ark_turn_around_time": null,
"byf_entryon": "10/22/2015 7:00:00 AM","byf_name": "X00000010","byf_casestatus": "Action
Required","byf_teethnumber": "U","byf_shade_list": "A1","createdon": "10/28/2015 10:10:31
AM","modifiedon": "10/28/2015 10:10:41 AM"}]

Javascript Code Sample:


The following Javascript code shows how to call GetCaseOrdersByPaging:
function GetCaseOrdersByPaging() {
$.ajax({
url: 'http://52.89.207.54/api/caseorders/1/10/createdon',
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function(data, status, xhr){
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}

BYF Dental. All rights reserved

Page 11

3.2.9 GeCaseOrderById
Description:
This will return a Dynamics CRM case order record.
Request Url:
http://52.89.207.54/api/caseorders/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
Case order id (Guid)

Response:
A dynamics crm case order record in json format.
{"Id":"12dcd70f-ee58-e511-80e43863bb3c1190","Name":null,"byf_caseorder":null,"byf_customer":{"Id":"4fc89135-a025-e51180fe-fc15b4283a2c","Name":"Patel, Neilesh,
DDS"},"ark_drinitials":null,"ark_listedduedate":"9/25/2015 7:00:00
AM","ark_prosthodontics":null,"byf_patientfullname":"Cynthia
Carter","ark_age":null,"ark_abutment":null,"byf_redo":"No"ark_turn_around_time": null,
"byf_entryon": "10/22/2015 7:00:00 AM","byf_name": "X00000010","byf_casestatus": "Action
Required","byf_teethnumber": "U","byf_shade_list": "A1","createdon": "10/28/2015 10:10:31
AM","modifiedon": "10/28/2015 10:10:41 AM"}

Javascript Code Sample:


The following Javascript code shows how to call GetCaseOrderById:
function GetCaseOrderById() {
var id = $('#txtId').val();
if (id != '') {
$.ajax({
url: 'http://52.89.207.54/api/caseorders/' + id,
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
ShowAccount(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 12

3.2.10 CreateCaseOrder
Description:
This will create a new case order record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseorders
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
CaseOrder

Type
string
string
object

Description
Api username
Password
An case order object

Response:
A dynamics crm case order record in json format.
{"Name":null,"byf_caseorder":null,"byf_customer":{"Id":"4fc89135-a025-e511-80fefc15b4283a2c","Name":"Patel, Neilesh,
DDS"},"ark_drinitials":null,"ark_listedduedate":"9/25/2015 7:00:00
AM","ark_prosthodontics":null,"byf_patientfullname":"Cynthia
Carter","ark_age":null,"ark_abutment":null,"byf_redo":"No"ark_turn_around_time": null,
"byf_entryon": "10/22/2015 7:00:00 AM","byf_name": "X00000010","byf_casestatus": "Action
Required","byf_teethnumber": "U","byf_shade_list": "A1"}

Javascript Code Sample:


The following Javascript code shows how to call CreateCaseOrder:
function CreateCaseOrder() {
var caseorder {
"byf_caseorder": null,
"byf_customer": {
"Id": "4fc89135-a025-e511-80fe-fc15b4283a2c"
},
"ark_drinitials": "intitial",
"ark_listedduedate": "9/25/2015 7:00:00 AM",
"ark_prosthodontics": "fixed restoration",
"byf_patientfullname": "Cynthia Carter",
"byf_redo": "No"
};
$.ajax({
url: 'http://52.89.207.54/api/caseorders,
type: 'POST',
data: JSON.stringify(caseorder),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 13

3.2.11 UpdateCaseOrder
Description:
This will update a case order record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseorders/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id
CaseOrder

Type
string
string
string
object

Description
Api username
Password
Case order id (guid)
An case order object

Response:
A dynamics crm case order record in json format.
{"Name":null,"byf_caseorder":null,"byf_customer":{"Id":"4fc89135-a025-e511-80fefc15b4283a2c","Name":"Patel, Neilesh,
DDS"},"ark_drinitials":null,"ark_listedduedate":"9/25/2015 7:00:00
AM","ark_prosthodontics":null,"byf_patientfullname":"Cynthia
Carter","ark_age":null,"ark_abutment":null,"byf_redo":"No"ark_turn_around_time": null,
"byf_entryon": "10/22/2015 7:00:00 AM","byf_name": "X00000010","byf_casestatus": "Action
Required","byf_teethnumber": "U","byf_shade_list": "A1"}

Javascript Code Sample:


The following Javascript code shows how to call CreateCaseOrder:
function UpdateCaseOrder() {
var caseorder {
"byf_caseorder": null,
"byf_customer": {
"Id": "4fc89135-a025-e511-80fe-fc15b4283a2c"
},
"ark_drinitials": "intitial",
"ark_listedduedate": "9/25/2015 7:00:00 AM",
"ark_prosthodontics": "fixed restoration",
"byf_patientfullname": "Cynthia Carter",
"byf_redo": "No"
};
$.ajax({
url: 'http://52.89.207.54/api/caseorders/' + id,
type: 'POST',
data: JSON.stringify(caseorder),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 14

3.2.12 DeleteCaseOrder
Description:
This will delete a case order record from Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseorders/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
Case order id (guid)

Response:
HTTP response
Javascript Code Sample:
The following Javascript code shows how to call DeleteCaseOrder:
function DeleteCaseOrder() {
var id = $('#txtId').val()
if (id != '') {
$.ajax({
url: 'http://52.89.207.54/api/caseorders/' + id,
type: 'DELETE',
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
WriteResponse(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 15

3.2.13 GetLatest10CaseInvoices
Description:
This will return a list of Dynamic CRM case invoice records.
Request Url:
http://52.89.207.54/api/caseinvoices
Request Parameters:
Name
X-ApiUsername
X-ApiPassword

Type
string
string

Description
Api username
Password

Response:
A list of dynamics crm case invoice records in json format.
[{"byf_caseinvoiceid":"5ec4f6b7-0658-e511-80e73863bb3610e8","byf_customer":{"Id":"bf0f911d-227e-e311-bb6d6c3be5a881a4","Name":"Timbers, Cory,
DDS"},"byf_name":"014255R","byf_invoicedate":"9/11/2015 7:00:00
AM","byf_caseorder":{"Id":"54afbcbf-6953-e511-80e03863bb347ba8","Name":null,"byf_caseorder":"B00010565","byf_customer":null,"ark_drinitials
":null,"ark_listedduedate":null,"ark_prosthodontics":null,"byf_patientfullname":null,"ark
_age":null,"ark_abutment":null,"byf_redo":null},"byf_patientfullname":"Gicela
Hernandez","byf_teethnumber":"30","byf_shadelist":"A1","ark_drname1":{"Id":"03202778137e-e311-bb6d-6c3be5a881a4","Name":"Cory Timbers, DDS,"firstname": "Cory","lastname":
"Timbers, DDS","middlename":null}, "byf_totalamount":0.0000, "ark_taxable_total":0.0000,
"byf_salestaxamount":0.0000,"byf_total_discount_amount":0.0000,"byf_finalamount":0.0000}
,{"byf_caseinvoiceid":"5115580f-d96e-e511-80ec-3863bb3610e8",
"byf_customer":{"Id":"7bd2bdeb-3469-e511-80e5-3863bb347ba8","Name":"DEV TEST"},
"byf_name":null,"byf_invoicedate":null,"byf_caseorder":null,"byf_patientfullname":null,"b
yf_teethnumber":null,"byf_shadelist":null,"ark_drname1":null,"byf_totalamount":100.0000,"
ark_taxable_total":13.0000,"byf_salestaxamount":0.0000,"byf_total_discount_amount":10.000
0,"byf_finalamount":100.0000}]

Javascript Code Sample:


The following Javascript code shows how to call GetLatest10CaseInvoices:
function GetAllCaseInvoices() {
$.ajax({
url: $('#txtApiBaseUrl').val() + '/api/caseinvoices',
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
3.2.14 GeCaseInvoicesByPaging
alert(textStatus);
}
Description:
});
}

BYF Dental. All rights reserved

Page 16

This will return a list of Dynamics CRM case invoice records based on page size,
page number and sort expression.
Request Url:
http://52.89.207.54/api/caseinvoices/pageNumber/pageSize/sortBy
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
PageNumber
PageSize
SortBy

Type
string
string
int
int
string

Description
Api username
Password
Page number.
Page size
Sort by param

Response:
A list of dynamics crm case invoice records in json format.
[{"byf_caseinvoiceid":"5ec4f6b7-0658-e511-80e73863bb3610e8","byf_customer":{"Id":"bf0f911d-227e-e311-bb6d6c3be5a881a4","Name":"Timbers, Cory,
DDS"},"byf_name":"014255R","byf_invoicedate":"9/11/2015 7:00:00
AM","byf_caseorder":{"Id":"54afbcbf-6953-e511-80e03863bb347ba8","Name":null,"byf_caseorder":"B00010565","byf_customer":null,"ark_drinitials
":null,"ark_listedduedate":null,"ark_prosthodontics":null,"byf_patientfullname":null,"ark
_age":null,"ark_abutment":null,"byf_redo":null},"byf_patientfullname":"Gicela
Hernandez","byf_teethnumber":"30","byf_shadelist":"A1","ark_drname1":{"Id":"03202778137e-e311-bb6d-6c3be5a881a4","Name":"Cory Timbers, DDS,"firstname": "Cory","lastname":
"Timbers, DDS","middlename":null}, "byf_totalamount":0.0000, "ark_taxable_total":0.0000,
"byf_salestaxamount":0.0000,"byf_total_discount_amount":0.0000,"byf_finalamount":0.0000}
,{"byf_caseinvoiceid":"5115580f-d96e-e511-80ec-3863bb3610e8",
"byf_customer":{"Id":"7bd2bdeb-3469-e511-80e5-3863bb347ba8","Name":"DEV TEST"},
"byf_name":null,"byf_invoicedate":null,"byf_caseorder":null,"byf_patientfullname":null,"b
yf_teethnumber":null,"byf_shadelist":null,"ark_drname1":null,"byf_totalamount":100.0000,"
ark_taxable_total":13.0000,"byf_salestaxamount":0.0000,"byf_total_discount_amount":10.000
0,"byf_finalamount":100.0000}]

Javascript Code Sample:


The following Javascript code shows how to call GetCaseInvoicesByPaging:
function GetCaseInvoicesByPaging() {
$.ajax({
url: 'http://52.89.207.54/api/caseinvoices/1/10/createdon',
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function(data, status, xhr){
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
3.2.115 GetCaseInvoiceById
}
});
Description:
}

BYF Dental. All rights reserved

Page 17

This will return a Dynamics CRM case invoice record.


Request Url:
http://52.89.207.54/api/caseinvoices/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
Case invoice id (Guid)

Response:
A dynamic crm case invoice record in json format.
{"byf_caseinvoiceid":"5ec4f6b7-0658-e511-80e73863bb3610e8","byf_customer":{"Id":"bf0f911d-227e-e311-bb6d6c3be5a881a4","Name":"Timbers, Cory,
DDS"},"byf_name":"014255R","byf_invoicedate":"9/11/2015 7:00:00
AM","byf_caseorder":{"Id":"54afbcbf-6953-e511-80e03863bb347ba8","Name":null,"byf_caseorder":"B00010565","byf_customer":null,"ark_drinitials
":null,"ark_listedduedate":null,"ark_prosthodontics":null,"byf_patientfullname":null,"ark
_age":null,"ark_abutment":null,"byf_redo":null},"byf_patientfullname":"Gicela
Hernandez","byf_teethnumber":"30","byf_shadelist":"A1","ark_drname1":{"Id":"03202778137e-e311-bb6d-6c3be5a881a4","Name":"Cory Timbers, DDS,"firstname": "Cory","lastname":
"Timbers, DDS","middlename":null}, "byf_totalamount":0.0000, "ark_taxable_total":0.0000,
"byf_salestaxamount":0.0000,"byf_total_discount_amount":0.0000,"byf_finalamount":0.0000}

Javascript Code Sample:


The following Javascript code shows how to call GetCaseInvoiceById:
function GetCaseInvoice() {
var id = $('#txtId').val();
if (id != '') {
$.ajax({
url: $('#txtApiBaseUrl').val() + '/api/caseinvoices/' + id,
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
ShowAccount(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 18

3.2.16 CreateCaseInvoice
Description:
This will create a new case invoice record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseinvoices
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
CaseInvoice

Type
string
string
object

Description
Api username
Password
An case invoice object

Response:
A dynamics crm case invoice record in json format.
{"byf_customer":{"Id":"bf0f911d-227e-e311-bb6d-6c3be5a881a4","Name":"Timbers, Cory,
DDS","CompanyName":null,"Telephone1":null,"Fax":null,"EmailAddress1":null,"PrimaryContact
":null,"Address1_Line1":null,"Address1_City":null,"Address1_StateOrProvince":null,"Addres
s1_PostalCode":null},"byf_name":"014255R","byf_invoicedate":"9/11/2015 7:00:00
AM","byf_caseorder":{"Id":"54afbcbf-6953-e511-80e03863bb347ba8","Name":null,"byf_caseorder":"B00010565","byf_customer":null,"ark_drinitials
":null,"ark_listedduedate":null,"ark_prosthodontics":null,"byf_patientfullname":null,"ark
_age":null,"ark_abutment":null,"byf_redo":null},"byf_patientfullname":"Gicela
Hernandez","byf_teethnumber":"30","byf_shadelist":"A1","ark_drname1":{"Id":"03202778137e-e311-bb6d-6c3be5a881a4","Name":"Cory Timbers,
DDS"},"byf_totalamount":0.0000,"ark_taxable_total":0.0000,"byf_salestaxamount":0.0000,"by
f_total_discount_amount":0.0000,"byf_finalamount":0.0000}

BYF Dental. All rights reserved

Page 19

Javascript Code Sample:


The following Javascript code shows how to call CreateCaseInvoice:
function CreateCaseInvoice() {
var caseinvoice = {
"byf_caseinvoiceid": "09a29fab-0658-e511-80e7-3863bb3610e8",
"byf_customer": {
"Id": "19b89b9a-b20b-e511-80fc-fc15b4283a2c"
},
"byf_name": "014262",
"byf_invoicedate": "9/11/2015 7:00:00 AM",
"byf_caseorder": {
"Id": "266de4ac-6a53-e511-80e0-3863bb347ba8"
},
"byf_patientfullname": "Dwayne Zaval",
"byf_teethnumber": "5",
"byf_shadelist": "D4/D3/D3",
"ark_drname1": {
"Id": "95ad9e5c-b20b-e511-80fc-fc15b4283a2c"
},
"byf_totalamount": 75,
"ark_taxable_total": 75,
"byf_salestaxamount": 0,
"byf_total_discount_amount": 0
};
$.ajax({
url: 'http://52.89.207.54/api/caseinvoices,
type: 'POST',
data: JSON.stringify(caseinvoice),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 20

3.2.17 UpdateCaseInvoice
Description:
This will update an case invoice record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseinvoices/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id
CaseInvoice

Type
string
string
string
object

Description
Api username
Password
Case Invoice id (guid)
A case invoice object

Response:
A dynamics crm account record in json format.
{"byf_customer":{"Id":"bf0f911d-227e-e311-bb6d-6c3be5a881a4","Name":"Timbers, Cory,
DDS","CompanyName":null,"Telephone1":null,"Fax":null,"EmailAddress1":null,"PrimaryContact
":null,"Address1_Line1":null,"Address1_City":null,"Address1_StateOrProvince":null,"Addres
s1_PostalCode":null},"byf_name":"014255R","byf_invoicedate":"9/11/2015 7:00:00
AM","byf_caseorder":{"Id":"54afbcbf-6953-e511-80e03863bb347ba8","Name":null,"byf_caseorder":"B00010565","byf_customer":null,"ark_drinitials
":null,"ark_listedduedate":null,"ark_prosthodontics":null,"byf_patientfullname":null,"ark
_age":null,"ark_abutment":null,"byf_redo":null},"byf_patientfullname":"Gicela
Hernandez","byf_teethnumber":"30","byf_shadelist":"A1","ark_drname1":{"Id":"03202778137e-e311-bb6d-6c3be5a881a4","Name":"Cory Timbers,
DDS"},"byf_totalamount":0.0000,"ark_taxable_total":0.0000,"byf_salestaxamount":0.0000,"by
f_total_discount_amount":0.0000,"byf_finalamount":0.0000}

BYF Dental. All rights reserved

Page 21

Javascript Code Sample:


The following Javascript code shows how to call UpdateCaseInvoice:
function UpdateAccount() {
var id = $('#txtId').val()
var caseinvoice = {
"byf_caseinvoiceid": "09a29fab-0658-e511-80e7-3863bb3610e8",
"byf_customer": {
"Id": "19b89b9a-b20b-e511-80fc-fc15b4283a2c"
},
"byf_name": "014262",
"byf_invoicedate": "9/11/2015 7:00:00 AM",
"byf_caseorder": {
"Id": "266de4ac-6a53-e511-80e0-3863bb347ba8"
},
"byf_patientfullname": "Dwayne Zaval",
"byf_teethnumber": "5",
"byf_shadelist": "D4/D3/D3",
"ark_drname1": {
"Id": "95ad9e5c-b20b-e511-80fc-fc15b4283a2c"
},
"byf_totalamount": 75,
"ark_taxable_total": 75,
"byf_salestaxamount": 0,
"byf_total_discount_amount": 0
};
$.ajax({
url: 'http://52.89.207.54/api/caseinvoices/' + id,
type: 'PUT',
data: JSON.stringify(account),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 22

3.2.18 DeleteCaseInvoice
Description:
This will delete a case invoice record from Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseinvoices/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
Case invoice id (guid)

Response:
HTTP response
Javascript Code Sample:
The following Javascript code shows how to call DeleteCaseInvoice:
function DeleteCaseInvoice() {
var id = $('#txtId').val()
if (id != '') {
$.ajax({
url: 'http://52.89.207.54/api/caseinvoices/' + id,
type: 'DELETE',
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
WriteResponse(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 23

3.2.19 GetLatest10CaseInvoiceItems
Description:
This will return a list of all Dynamics CRM case invoice item records.
Request Url:
http://52.89.207.54/api/caseinvoiceitems
Request Parameters:
Name
X-ApiUsername
X-ApiPassword

Type
string
string

Description
Api username
Password

Response:
A list of dynamics crm case invoice item records in json format.
[{"byf_caseinvoiceitemid":"f19bf8bd-0658-e511-80e73863bb3610e8","byf_product":{"Id":"de7a5222-db77-e311-bb6d6c3be5a881a4","Name":"FEX020"},"byf_quantity":1.0000000000,"byf_amount":0.0000,"byf_exten
dedamount":0.0000,"byf_caseinvoice":{"byf_caseinvoiceid":"5ec4f6b7-0658-e511-80e73863bb3610e8","byf_customer":null,"byf_name":"014255R","byf_invoicedate":null,"byf_caseor
der":null,"byf_patientfullname":null,"byf_teethnumber":null,"byf_shadelist":null,"ark_drn
ame1":null,"byf_totalamount":0.0,"ark_taxable_total":0.0,"byf_salestaxamount":0.0,"byf_to
tal_discount_amount":0.0,"byf_finalamount":0.0}},{"byf_caseinvoiceitemid":"ea9bf8bd-0658e511-80e7-3863bb3610e8","byf_product":{"Id":"5d40344e-b50b-e411-88266c3be5a8362c","Name":"MTL210"},"byf_quantity":1.0000000000,"byf_amount":0.0000,"byf_exten
dedamount":0.0000,"byf_caseinvoice":{"byf_caseinvoiceid":"5ec4f6b7-0658-e511-80e73863bb3610e8","byf_customer":null,"byf_name":"014255R","byf_invoicedate":null,"byf_caseor
der":null,"byf_patientfullname":null,"byf_teethnumber":null,"byf_shadelist":null,"ark_drn
ame1":null,"byf_totalamount":0.0,"ark_taxable_total":0.0,"byf_salestaxamount":0.0,"byf_to
tal_discount_amount":0.0,"byf_finalamount":0.0}}]

Javascript Code Sample:


The following Javascript code shows how to call GetLatest10CaseInvoiceItems:
function GetAllCaseInvoiceItems() {
$.ajax({
url: $('#txtApiBaseUrl').val() + '/api/caseinvoiceitems,
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}

BYF Dental. All rights reserved

Page 24

3.2.20 GeCaseInvoiceItemsByPaging
Description:
This will return a list of Dynamics CRM case invoice item records based on page
size, page number and sort expression.
Request Url:
http://52.89.207.54/api/caseinvoiceitems/pageNumber/pageSize/sortBy
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
PageNumber
PageSize
SortBy

Type
string
string
int
int
string

Description
Api username
Password
Page number.
Page size
Sort by param

Response:
A list of dynamics crm case invoice item records in json format.
[{"byf_caseinvoiceitemid":"f19bf8bd-0658-e511-80e73863bb3610e8","byf_product":{"Id":"de7a5222-db77-e311-bb6d6c3be5a881a4","Name":"FEX020"},"byf_quantity":1.0000000000,"byf_amount":0.0000,"byf_exten
dedamount":0.0000,"byf_caseinvoice":{"byf_caseinvoiceid":"5ec4f6b7-0658-e511-80e73863bb3610e8","byf_customer":null,"byf_name":"014255R","byf_invoicedate":null,"byf_caseor
der":null,"byf_patientfullname":null,"byf_teethnumber":null,"byf_shadelist":null,"ark_drn
ame1":null,"byf_totalamount":0.0,"ark_taxable_total":0.0,"byf_salestaxamount":0.0,"byf_to
tal_discount_amount":0.0,"byf_finalamount":0.0}},{"byf_caseinvoiceitemid":"ea9bf8bd-0658e511-80e7-3863bb3610e8","byf_product":{"Id":"5d40344e-b50b-e411-88266c3be5a8362c","Name":"MTL210"},"byf_quantity":1.0000000000,"byf_amount":0.0000,"byf_exten
dedamount":0.0000,"byf_caseinvoice":{"byf_caseinvoiceid":"5ec4f6b7-0658-e511-80e73863bb3610e8","byf_customer":null,"byf_name":"014255R","byf_invoicedate":null,"byf_caseor
der":null,"byf_patientfullname":null,"byf_teethnumber":null,"byf_shadelist":null,"ark_drn
ame1":null,"byf_totalamount":0.0,"ark_taxable_total":0.0,"byf_salestaxamount":0.0,"byf_to
tal_discount_amount":0.0,"byf_finalamount":0.0}}]

Javascript Code Sample:


The following Javascript code shows how to call GetCaseInvoiceItemsByPaging:
function GetCaseInvoicesByPaging() {
$.ajax({
url: 'http://52.89.207.54/api/caseinvoiceitems/1/10/createdon',
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function(data, status, xhr){
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}

BYF Dental. All rights reserved

Page 25

3.2.21 GetCaseInvoiceItemById
Description:
This will return a Dynamics CRM case invoice item record.
Request Url:
http://52.89.207.54/api/caseinvoiceitems/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
Case invoice item id (Guid)

Response:
A dynamic crm case invoice item record in json format.
{"byf_caseinvoiceitemid":"f19bf8bd-0658-e511-80e73863bb3610e8","byf_product":{"Id":"de7a5222-db77-e311-bb6d6c3be5a881a4","Name":"FEX020"},"byf_quantity":1.0000000000,"byf_amount":0.0000,"byf_exten
dedamount":0.0000,"byf_caseinvoice":{"byf_caseinvoiceid":"5ec4f6b7-0658-e511-80e73863bb3610e8","byf_customer":null,"byf_name":"014255R","byf_invoicedate":null,"byf_caseor
der":null,"byf_patientfullname":null,"byf_teethnumber":null,"byf_shadelist":null,"ark_drn
ame1":null,"byf_totalamount":0.0,"ark_taxable_total":0.0,"byf_salestaxamount":0.0,"byf_to
tal_discount_amount":0.0,"byf_finalamount":0.0}}

Javascript Code Sample:


The following Javascript code shows how to call GetCaseInvoiceItemById:
function GetCaseInvoice() {
var id = $('#txtId').val();
if (id != '') {
$.ajax({
url: $('#txtApiBaseUrl').val() + '/api/caseinvoiceitems/' + id,
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
ShowAccount(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 26

3.2.22 CreateCaseInvoiceItem
Description:
This will create a new case invoice item record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseinvoiceitems
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
CaseInvoiceItem

Type
string
string
object

Description
Api username
Password
A case invoice item

Response:
A dynamics crm case invoice item record in json format.
{"byf_product":{"Id":"de7a5222-db77-e311-bb6d6c3be5a881a4","Name":"FEX020"},"byf_quantity":1.0000000000,"byf_amount":0.0000,"byf_exten
dedamount":0.0000,"byf_caseinvoice":{"byf_caseinvoiceid":"5ec4f6b7-0658-e511-80e73863bb3610e8","byf_customer":null,"byf_name":"014255R","byf_invoicedate":null,"byf_caseor
der":null,"byf_patientfullname":null,"byf_teethnumber":null,"byf_shadelist":null,"ark_drn
ame1":null,"byf_totalamount":0.0,"ark_taxable_total":0.0,"byf_salestaxamount":0.0,"byf_to
tal_discount_amount":0.0,"byf_finalamount":0.0}}

Javascript Code Sample:


The following Javascript code shows how to call CreateCaseInvoiceItem:
function CreateCaseInvoiceItem() {
var caseinvoiceitem = {
"byf_product": {
"Id": "7373e137-190d-e411-b432-6c3be5a815e4"
},
"byf_quantity": 1,
"byf_amount": 70,
"byf_extendedamount": 70,
"byf_caseinvoice": {
"byf_caseinvoiceid": "89a0a8b1-0658-e511-80e7-3863bb3610e8"
};
$.ajax({
url: 'http://52.89.207.54/api/caseinvoiceitems',
type: 'POST',
data: JSON.stringify(caseinvoiceitem),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 27

3.2.23 UpdateCaseInvoiceItem
Description:
This will update a case invoice item record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseinvoiceitems/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id
CaseInvoiceItem

Type
string
string
GUID
object

Description
Api username
Password
Case invoice item id
A case invoice item

Response:
A dynamics crm case invoice item record in json format.
{"byf_product":{"Id":"de7a5222-db77-e311-bb6d6c3be5a881a4","Name":"FEX020"},"byf_quantity":1.0000000000,"byf_amount":0.0000,"byf_exten
dedamount":0.0000,"byf_caseinvoice":{"byf_caseinvoiceid":"5ec4f6b7-0658-e511-80e73863bb3610e8","byf_customer":null,"byf_name":"014255R","byf_invoicedate":null,"byf_caseor
der":null,"byf_patientfullname":null,"byf_teethnumber":null,"byf_shadelist":null,"ark_drn
ame1":null,"byf_totalamount":0.0,"ark_taxable_total":0.0,"byf_salestaxamount":0.0,"byf_to
tal_discount_amount":0.0,"byf_finalamount":0.0}}

Javascript Code Sample:


The following Javascript code shows how to call UpdateCaseInvoiceItem:
function CreateCaseInvoiceItem() {
var caseinvoiceitem = {
"byf_product": {
"Id": "7373e137-190d-e411-b432-6c3be5a815e4"
},
"byf_quantity": 1,
"byf_amount": 70,
"byf_extendedamount": 70,
"byf_caseinvoice": {
"byf_caseinvoiceid": "89a0a8b1-0658-e511-80e7-3863bb3610e8"
};
$.ajax({
url: 'http://52.89.207.54/api/caseinvoiceitems/' + id,
type: 'POST',
data: JSON.stringify(caseinvoiceitem),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 28

3.2.24 DeleteCaseInvoiceItem
Description:
This will delete a case invoice item record from Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseinvoiceitems/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
Case invoice item id (guid)

Response:
HTTP response
Javascript Code Sample:
The following Javascript code shows how to call DeleteCaseInvoiceItem:
function DeleteCaseInvoiceItem() {
var id = $('#txtId').val()
if (id != '') {
$.ajax({
url: 'http://52.89.207.54/api/caseinvoiceitems/' + id,
type: 'DELETE',
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
WriteResponse(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 29

3.2.25 GetLatest10CaseIssues
Description:
This will return a list of all Dynamics CRM case issue records.
Request Url:
http://52.89.207.54/api/caseissues
Request Parameters:
Name
X-ApiUsername
X-ApiPassword

Type
string
string

Description
Api username
Password

Response:
A list of dynamics crm case issue records in json format.
[{"byf_caseissueid":"7d004470-e271-e511-80e53863bb347ba8","byf_caseorder":{"Id":"9bf3bd25-ea58-e511-80e43863bb3c1190","Name":"B00010696"},"ark_category1":{"Id":"67afcbf7-c5dc-e411-80fcc4346bacdc5c","Name":"Shipping Out Case"},"byf_customer":{"Id":"cfef87b5-e120-e511-80fefc15b4283a2c","Name":"Thanh, Kelly,
DDS"},"ark_drcost":92.4500,"byf_response_time":null,"createdon":"10/13/2015 7:41:51
PM","modifiedon":"10/13/2015 7:41:55 PM"},{"byf_caseissueid":"5c25cfc7-5261-e511-80e03863bb347ba8"," byf_caseorder":{"Id":"9bf3bd25-ea58-e511-80e43863bb3c1190","Name":"B00010696"},"ark_category1":{"Id":"67afcbf7-c5dc-e411-80fcc4346bacdc5c","Name":"Shipping Out Case"},"byf_customer":{"Id":"cfef87b5-e120-e511-80fefc15b4283a2c","Name":"Thanh, Kelly,
DDS"},"ark_drcost":92.4500,"byf_response_time":null,"createdon":"10/13/2015 7:41:51
PM","modifiedon":"10/13/2015 7:41:55 PM"}]

Javascript Code Sample:


The following Javascript code shows how to call GetLatest10CaseIssues:
function GetAllCaseIssues() {
$.ajax({
url: $('#txtApiBaseUrl').val() + '/api/caseissues,
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}

BYF Dental. All rights reserved

Page 30

3.2.26 GeCaseIssuesByPaging
Description:
This will return a list of Dynamics CRM case issue records based on page size, page
number and sort expression.
Request Url:
http://52.89.207.54/api/caseissues/pageNumber/pageSize/sortBy
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
PageNumber
PageSize
SortBy

Type
string
string
int
int
string

Description
Api username
Password
Page number.
Page size
Sort by param

Response:
A list of dynamics crm case invoice item records in json format.
[{"byf_caseissueid":"7d004470-e271-e511-80e53863bb347ba8","byf_caseorder":{"Id":"9bf3bd25-ea58-e511-80e43863bb3c1190","Name":"B00010696"},"ark_category1":{"Id":"67afcbf7-c5dc-e411-80fcc4346bacdc5c","Name":"Shipping Out Case"},"byf_customer":{"Id":"cfef87b5-e120-e511-80fefc15b4283a2c","Name":"Thanh, Kelly,
DDS"},"ark_drcost":92.4500,"byf_response_time":null,"createdon":"10/13/2015 7:41:51
PM","modifiedon":"10/13/2015 7:41:55 PM"},{"byf_caseissueid":"5c25cfc7-5261-e511-80e03863bb347ba8"," byf_caseorder":{"Id":"9bf3bd25-ea58-e511-80e43863bb3c1190","Name":"B00010696"},"ark_category1":{"Id":"67afcbf7-c5dc-e411-80fcc4346bacdc5c","Name":"Shipping Out Case"},"byf_customer":{"Id":"cfef87b5-e120-e511-80fefc15b4283a2c","Name":"Thanh, Kelly,
DDS"},"ark_drcost":92.4500,"byf_response_time":null,"createdon":"10/13/2015 7:41:51
PM","modifiedon":"10/13/2015 7:41:55 PM"}]

Javascript Code Sample:


The following Javascript code shows how to call GetCaseIssuesByPaging:
function GetCaseInvoicesByPaging() {
$.ajax({
url: 'http://52.89.207.54/api/caseissues/1/10/createdon',
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function(data, status, xhr){
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}

BYF Dental. All rights reserved

Page 31

3.2.27 GetCaseIssueById
Description:
This will return a Dynamics CRM case issue record.
Request Url:
http://52.89.207.54/api/caseissues/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
Case issue id (Guid)

Response:
A dynamic crm case issue record in json format.
{"byf_caseissueid":"7d004470-e271-e511-80e53863bb347ba8","byf_caseorder":{"Id":"9bf3bd25-ea58-e511-80e43863bb3c1190","Name":"B00010696"},"ark_category1":{"Id":"67afcbf7-c5dc-e411-80fcc4346bacdc5c","Name":"Shipping Out Case"},"byf_customer":{"Id":"cfef87b5-e120-e511-80fefc15b4283a2c","Name":"Thanh, Kelly,
DDS"},"ark_drcost":92.4500,"byf_response_time":null,"createdon":"10/13/2015 7:41:51
PM","modifiedon":"10/13/2015 7:41:55 PM"}

Javascript Code Sample:


The following Javascript code shows how to call GetCaseInvoiceById:
function GetCaseIssue() {
var id = $('#txtId').val();
if (id != '') {
$.ajax({
url: $('#txtApiBaseUrl').val() + '/api/caseissues/' + id,
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
ShowAccount(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 32

3.2.28 CreateCaseIssue
Description:
This will create a new case issue record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseissues
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
CaseInvoiceItem

Type
string
string
object

Description
Api username
Password
A case issue object

Response:
A dynamics crm case issue record in json format.
{"byf_caseorder":{"Id":"9bf3bd25-ea58-e511-80e43863bb3c1190","Name":"B00010696"},"ark_category1":{"Id":"67afcbf7-c5dc-e411-80fcc4346bacdc5c","Name":"Shipping Out Case"},"byf_customer":{"Id":"cfef87b5-e120-e511-80fefc15b4283a2c","Name":"Thanh, Kelly,
DDS"},"ark_drcost":92.4500,"byf_response_time":null,"createdon":"10/13/2015 7:41:51
PM","modifiedon":"10/13/2015 7:41:55 PM"}

Javascript Code Sample:


The following Javascript code shows how to call CreateCaseIssue:
function CreateIssue() {
var caseissue = {
"byf_caseorder": {
"Id": "9bf3bd25-ea58-e511-80e4-3863bb3c1190"
},
"ark_category1": {
"Id": "67afcbf7-c5dc-e411-80fc-c4346bacdc5c"
}
};
$.ajax({
url: 'http://52.89.207.54/api/caseissues,
type: 'POST',
data: JSON.stringify(caseissue),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 33

3.2.29 UpdateCaseIssue
Description:
This will update a case issue record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseissues/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id
CaseIssue

Type
string
string
GUID
object

Description
Api username
Password
Case issue id
A case issue object

Response:
A dynamics crm case issue record in json format.
{"byf_caseorder":{"Id":"9bf3bd25-ea58-e511-80e43863bb3c1190","Name":"B00010696"},"ark_category1":{"Id":"67afcbf7-c5dc-e411-80fcc4346bacdc5c","Name":"Shipping Out Case"},"byf_customer":{"Id":"cfef87b5-e120-e511-80fefc15b4283a2c","Name":"Thanh, Kelly,
DDS"},"ark_drcost":92.4500,"byf_response_time":null,"createdon":"10/13/2015 7:41:51
PM","modifiedon":"10/13/2015 7:41:55 PM"}

Javascript Code Sample:


The following Javascript code shows how to call UpdateCaseIssue:
function UpdateIssue() {
var caseissue = {
"byf_caseorder": {
"Id": "9bf3bd25-ea58-e511-80e4-3863bb3c1190"
},
"ark_category1": {
"Id": "67afcbf7-c5dc-e411-80fc-c4346bacdc5c"
}
};
$.ajax({
url: 'http://52.89.207.54/api/caseissues/' + id,,
type: 'POST',
data: JSON.stringify(caseissue),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 34

3.2.30 DeleteCaseIssue
Description:
This will delete a case issue record from Dynamics CRM.
Request Url:
http://52.89.207.54/api/caseissues/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
Case issue id (guid)

Response:
HTTP response
Javascript Code Sample:
The following Javascript code shows how to call DeleteCaseIssue:
function DeleteCaseIssue() {
var id = $('#txtId').val()
if (id != '') {
$.ajax({
url: 'http://52.89.207.54/api/caseissues/' + id,
type: 'DELETE',
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
WriteResponse(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 35

3.2.31 GetLatest10RMAs
Description:
This will return a list of all Dynamics CRM RMA records.
Request Url:
http://52.89.207.54/api/rms
Request Parameters:
Name
X-ApiUsername
X-ApiPassword

Type
string
string

Description
Api username
Password

Response:
A list of dynamics crm rma records in json format.
[{"byf_rmaid": "c0f5cdf3-5757-e511-80e0-3863bb347ba8","ark_redo": 172940000,
"byf_redorepairreason": 172940052, "ark_rootcause1": {"Id": "6f810252-9cc6-e411-80e3c4346bad36a8","Name": "RRC032"},"ark_rootcausedescription1": "New bite provided",
"byf_customer":{"Id":"cfef87b5-e120-e511-80fe-fc15b4283a2c","Name":"Thanh, Kelly,
DDS"},"ark_drcost":92.4500, "byf_typeofreturn": "Repair","createdon": "9/10/2015 1:05:00
AM","modifiedon": "9/11/2015 2:41:00 PM"},{"byf_rmaid": "6bea365f-5657-e511-80e03863bb347ba8","ark_redo": 172940000,"byf_redorepairreason": 172940011,"ark_rootcause1":
{"Id": "8f810252-9cc6-e411-80e3-c4346bad36a8","Name":
"RRC048"},"ark_rootcausedescription1": "Other", "byf_customer":{"Id":"cfef87b5-e120-e51180fe-fc15b4283a2c","Name":"Thanh, Kelly, DDS"},"ark_drcost":92.4500, "byf_typeofreturn":
"Repair","createdon": "9/10/2015 12:53:39 AM","modifiedon": "10/23/2015 8:37:55 PM"}]

Javascript Code Sample:


The following Javascript code shows how to call GetLatestRMAs:
function GetAllRMAs() {
$.ajax({
url: $('#txtApiBaseUrl').val() + '/api/rmas,
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}

BYF Dental. All rights reserved

Page 36

3.2.32 GetRMAsByPaging
Description:
This will return a list of Dynamics CRM RMA records based on page size, page
number and sort expression.
Request Url:
http://52.89.207.54/api/rmas/pageNumber/pageSize/sortBy
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
PageNumber
PageSize
SortBy

Type
string
string
int
int
string

Description
Api username
Password
Page number.
Page size
Sort by param

Response:
A list of dynamics crm RMA records in json format.
[{"byf_rmaid": "c0f5cdf3-5757-e511-80e0-3863bb347ba8","ark_redo": 172940000,
"byf_redorepairreason": 172940052, "ark_rootcause1": {"Id": "6f810252-9cc6-e411-80e3c4346bad36a8","Name": "RRC032"},"ark_rootcausedescription1": "New bite provided",
"byf_customer":{"Id":"cfef87b5-e120-e511-80fe-fc15b4283a2c","Name":"Thanh, Kelly,
DDS"},"ark_drcost":92.4500, "byf_typeofreturn": "Repair","createdon": "9/10/2015 1:05:00
AM","modifiedon": "9/11/2015 2:41:00 PM"},{"byf_rmaid": "6bea365f-5657-e511-80e03863bb347ba8","ark_redo": 172940000,"byf_redorepairreason": 172940011,"ark_rootcause1":
{"Id": "8f810252-9cc6-e411-80e3-c4346bad36a8","Name":
"RRC048"},"ark_rootcausedescription1": "Other", "byf_customer":{"Id":"cfef87b5-e120-e51180fe-fc15b4283a2c","Name":"Thanh, Kelly, DDS"},"ark_drcost":92.4500, "byf_typeofreturn":
"Repair","createdon": "9/10/2015 12:53:39 AM","modifiedon": "10/23/2015 8:37:55 PM"}]

Javascript Code Sample:


The following Javascript code shows how to call GetRMAsByPaging:
function GetCaseInvoicesByPaging() {
$.ajax({
url: 'http://52.89.207.54/api/rmas/1/10/createdon',
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function(data, status, xhr){
WriteResponse(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}

BYF Dental. All rights reserved

Page 37

3.2.33 GetRMAById
Description:
This will return a Dynamics CRM RMA record.
Request Url:
http://52.89.207.54/api/rmas/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
string

Description
Api username
Password
RMA id (Guid)

Response:
A dynamic CRM RMA record in json format.
{"byf_rmaid": "c0f5cdf3-5757-e511-80e0-3863bb347ba8","ark_redo": 172940000,
"byf_redorepairreason": 172940052, "ark_rootcause1": {"Id": "6f810252-9cc6-e411-80e3c4346bad36a8","Name": "RRC032"},"ark_rootcausedescription1": "New bite provided",
"byf_customer":{"Id":"cfef87b5-e120-e511-80fe-fc15b4283a2c","Name":"Thanh, Kelly,
DDS"},"ark_drcost":92.4500, "byf_typeofreturn": "Repair","createdon": "9/10/2015 1:05:00
AM","modifiedon": "9/11/2015 2:41:00 PM"}

Javascript Code Sample:


The following Javascript code shows how to call GetRMAById:
function GetRMAById() {
var id = $('#txtId').val();
if (id != '') {
$.ajax({
url: $('#txtApiBaseUrl').val() + '/api/rmas/' + id,
type: 'GET',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data, status, xhr) {
ShowAccount(data);
},
error: function (xhr, textStatus, errorThrown) {
alert(textStatus);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 38

3.2.34 CreateRMA
Description:
This will create a new RMA record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/rmas
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
RMA

Type
string
string
object

Description
Api username
Password
A rma object

Response:
A dynamics crm rma record in json format.
{"ark_redo": 172940000, "byf_redorepairreason": 172940052, "ark_rootcause1": {"Id":
"6f810252-9cc6-e411-80e3-c4346bad36a8","Name": "RRC032"},"ark_rootcausedescription1":
"New bite provided", "byf_customer":{"Id":"cfef87b5-e120-e511-80fefc15b4283a2c","Name":"Thanh, Kelly, DDS"},"ark_drcost":92.4500, "byf_typeofreturn":
"Repair"}

Javascript Code Sample:


The following Javascript code shows how to call CreateRMA:
function CreateRMA() {
var rma = {
"ark_redo": 172940000,
"byf_redorepairreason": 172940011,
"ark_rootcause1": {
"Id": "8f810252-9cc6-e411-80e3-c4346bad36a8"
},
"ark_rootcausedescription1": "Other"
};
$.ajax({
url: 'http://52.89.207.54/api/rmas,
type: 'POST',
data: JSON.stringify(rma),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 39

3.2.45 UpdateRMA
Description:
This will update a RMA record in Dynamics CRM.
Request Url:
http://52.89.207.54/api/rmas/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id
RMA

Type
string
string
GUID
object

Description
Api username
Password
RMA id
A rma object

Response:
A dynamics crm case issue record in json format.
{"ark_redo": 172940000, "byf_redorepairreason": 172940052, "ark_rootcause1": {"Id":
"6f810252-9cc6-e411-80e3-c4346bad36a8","Name": "RRC032"},"ark_rootcausedescription1":
"New bite provided", "byf_customer":{"Id":"cfef87b5-e120-e511-80fefc15b4283a2c","Name":"Thanh, Kelly, DDS"},"ark_drcost":92.4500, "byf_typeofreturn":
"Repair"}

Javascript Code Sample:


The following Javascript code shows how to call UpdateRMA:
function UpdateRMA() {
var rma = {
"ark_redo": 172940000,
"byf_redorepairreason": 172940011,
"ark_rootcause1": {
"Id": "8f810252-9cc6-e411-80e3-c4346bad36a8"
},
"ark_rootcausedescription1": "Other"
};
$.ajax({
url: 'http://52.89.207.54/api/rmas/' + id,,
type: 'POST',
data: JSON.stringify(caseissue),
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
ShowAccount(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}

BYF Dental. All rights reserved

Page 40

3.2.36 DeleteRMA
Description:
This will delete a RMA record from Dynamics CRM.
Request Url:
http://52.89.207.54/api/rmas/id
Request Parameters:
Name
X-ApiUsername
X-ApiPassword
Id

Type
string
string
GUID

Description
Api username
Password
RMA id (guid)

Response:
HTTP response
Javascript Code Sample:
The following Javascript code shows how to call DeleteRMA:
function DeleteRMA() {
var id = $('#txtId').val()
if (id != '') {
$.ajax({
url: 'http://52.89.207.54/api/rmas/' + id,
type: 'DELETE',
contentType: "application/json;charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader('X-ApiUsername', 'byfdeveloper');
xhr.setRequestHeader('x-ApiPassword', 'ByFD3v3l0per$2015');
},
success: function (data) {
WriteResponse(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}
else {
alert("Id is missing.");
}
}

BYF Dental. All rights reserved

Page 41

3.3 Error Code and Error Message


3.3.1 Error Code and Error Message
Description:
System when generate any error user will get a custom error message with error
code. Bellow table shows all error messages corresponding of their code number.
Error Code and Error Message:
TBD
Error Code

Error Message

BYF Dental. All rights reserved

Page 42

Vous aimerez peut-être aussi