WebEOC - earthtechint.comearthtechint.com/ftp/WebEOC_API_Technical_Guide_7-6.pdf · Get the WebEOC...

72
WebEOC ® API Technical Guide Version 7.6 and Later

Transcript of WebEOC - earthtechint.comearthtechint.com/ftp/WebEOC_API_Technical_Guide_7-6.pdf · Get the WebEOC...

WebEOC® API Technical Guide

Version 7.6 and Later

© 2014 Intermedix Corporation. All rights reserved. This document contains confidential or proprietary information of Intermedix Corporation, and distribution should be limited to authorized persons only.

Be aware that any disclosure, copying, distribution, or unauthorized and/or commercial use is strictly prohibited. While every precaution has been taken

in the preparation of this document, Intermedix Corporation assumes no responsibility for errors or omissions. Neither is any liability assumed for

damages resulting from the use of the information contained herein.

WebEOC® and ESi® are registered trademarks of ESi Acquisition, Inc.

Microsoft®, Windows®, and Internet Explorer® are registered trademarks of Microsoft Corporation.

All other trademarks are the property of their respective companies.

Address any questions, comments, or suggestions to: [email protected]

888-971-2250

6451 N. Federal Highway, Suite 1000

Fort Lauderdale, FL 3330

www.intermedix.com

Table of Contents WebEOC API Technical Information ......................................................................................................... 1

Objects ......................................................................................................................................................... 3

WebEOCCredentials ................................................................................................................................. 3

WebEOCUser ............................................................................................................................................ 4

WebEOCGroup ......................................................................................................................................... 5

Methods........................................................................................................................................................ 7

Access ....................................................................................................................................................... 7

Summary ................................................................................................................................................... 8

Automatic Code Generation .................................................................................................................... 11

Groups ..................................................................................................................................................... 11

Add a Group ......................................................................................................................................... 11

Edit a Group ......................................................................................................................................... 12

Get a Group ......................................................................................................................................... 14

Get Group Names ................................................................................................................................ 14

Delete a Group ..................................................................................................................................... 15

Users and Positions ................................................................................................................................. 16

Add a User ........................................................................................................................................... 16

Edit a User ........................................................................................................................................... 17

Add a User to a Position ...................................................................................................................... 18

Remove a User from a Position ........................................................................................................... 19

Get a User ............................................................................................................................................ 20

Get Usernames .................................................................................................................................... 21

Get All Positions or Users in WebEOC ................................................................................................ 22

Delete a User ....................................................................................................................................... 25

Incidents .................................................................................................................................................. 27

Add an Incident .................................................................................................................................... 27

i

Table of Contents

Get the Incidents List ........................................................................................................................... 28

Boards ..................................................................................................................................................... 29

Add a New Board Entry ....................................................................................................................... 29

Add a Related Board Record ............................................................................................................... 31

Add Attachment to a Board Record ..................................................................................................... 33

Update an Existing Board Entry ........................................................................................................... 34

Update a Related Board Entry ............................................................................................................. 36

Add or Update Multiple Records at One Time ..................................................................................... 37

Get Board Data .................................................................................................................................... 42

Get Board Data by Data Id .................................................................................................................. 44

Get Filtered Board Data ....................................................................................................................... 45

Get Updated Board Data ..................................................................................................................... 47

Get an Attachment ............................................................................................................................... 49

Get the WebEOC Board List ................................................................................................................ 51

Get the View List for a Board ............................................................................................................... 51

Get the List of View Fields ................................................................................................................... 52

Lists ......................................................................................................................................................... 53

Add or Rename a List or List Item ....................................................................................................... 53

Get All Lists in WebEOC ...................................................................................................................... 56

Get Items in a List ................................................................................................................................ 57

Delete a List or List Item ...................................................................................................................... 59

Check Connectivity and Credentials in WebEOC ................................................................................... 61

Glossary ..................................................................................................................................................... 63

Index ........................................................................................................................................................... 65

ii

WebEOC API Technical Information WebEOC's application programming interface (API) functions and features allow you to set up your

WebEOC system to exchange data with third-party applications. Interfaces can be built using a group of

widely adopted standards that are natively supported by many mainstream development environments.

This technical guide is intended to aid software developers in making use of the WebEOC API. It

assumes the developer is skilled in basic object-oriented programming concepts and has an advanced,

administrator level understanding of WebEOC.

The API is a web service using the Simple Object Access Protocol (SOAP) specification. Code generation

utilities use the Web Services Description Language (WSDL) file to automatically create helper proxy

classes and the underlying SOAP bindings. These generation utilities exist for many popular development

environments or languages, such as Java, .NET, Python, and Ruby. An example of code generation for

.NET is included in this guide.

The methods described in this guide are available with the following versions of the API: WebEOC 7.6 or

higher.

1

Objects These topics address objects necessary to building and using interfaces.

Note: Users who are Sub-Administrators do not have any administrator access to API methods. This means that they are functionally equivalent to regular users, and so can only access non-administrator API methods.

Click the appropriate link in this summary to view details about that object.

Name Description

WebEOCCredentials Object

All authentication values for the web service pass through this object.

WebEOCUser Object

Encapsulates information describing a single WebEOC user.

Some of the user and position methods make use of the WebEOCUser object.

WebEOCGroup Object Encapsulates information for a single group.

WebEOCCredentials

Authentication values for the web service are passed using the WebEOCCredentials object. This object

contains all the information WebEOC needs to verify whether it should perform a requested operation. In

general, the credentials object contains the information a user would have to supply when logging into

WebEOC.

The credentials object is a required parameter for all web methods and contains the following properties:

● Username (required) – WebEOC user to perform the requested operation.

● Password (required) – Password for the user specified by Username.

● Position (required) – Position the WebEOC user is assigned to.

● Incident (conditionally required) – WebEOC incident to log into while performing the requested

operation.

● Jurisdiction (optional) – WebEOC jurisdiction to log into while performing the requested

operation.

3

Objects

The API follows the standard WebEOC login process. As a result, values contained within the credentials

object cannot circumvent normal WebEOC permissions. For example, for the operation to succeed, the

user in Username must have access to the named incident and cannot currently be locked out.

Example

//Instantiate the WebEOCCredentials object

WebEOCCredentials credentials = new WebEOCCredentials();

//Set our values

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

credentials.Incident = "Downtown Flood";

credentials.Jurisdiction = "Chatham County";

WebEOCUser

The WebEOCUser object encapsulates information describing a single WebEOC user. This object is

used when retrieving user information from the API or when adding a user to WebEOC via the API.

The WebEOCUser object contains the following fields:

Field Type Description

Username String User name for the WebEOC user.

IsAdministrator Boolean

Flag indicating whether the WebEOC user is an administrator.

Default: false

IsMultipleUserLogin Boolean

Flag indicating whether the WebEOC user is set for multiple user login.

Default: false

IsAccountDisabled Boolean

Flag indicating whether the WebEOC user account is currently disabled.

Default: false

4

WebEOC API Technical Guide

Field Type Description

ChangePasswordAtNextLogin Boolean

Flag indicating whether the WebEOC user must change their password on the next login.

Default: false

IsDualCommitUser Boolean

Flag indicating whether the WebEOC user is a dual commit user.

Default: false

PrimaryEmail String Primary email address of the WebEOC user.

Color String Six-character hexadecimal value indicating the default color for the WebEOC user.

WebEOCGroup

The WebEOCGroup object allows reading and writing of the following properties:

● Name – Group name. After a group has been added with a particular name, its name cannot be

changed.

● Comment – Comment on the group.

● Organizational – Boolean value indicating whether the group is an organizational group.

● AssignedPositions – Array of positions assigned to the group.

● AssignedIncidents – Array of incidents assigned to the group.

5

Methods These topics cover the steps involved with using the web service.

Each topic provides one or more specific examples of calling the method. The Shelters and Press

Release boards are used in some of the examples.

Note: Boards used in examples can be obtained from running the WebEOC board installers included with WebEOC versions prior to version 7.4.

The following sections provide notes on access, an overview of methods and automatic code generation,

and links to specific topics on each method:

● Access

● Summary

● Automatic code generation

Access

Some API functions require a certain level of administrative access, such as access to the Boards

Manager, Lists Manager, or Groups Manager. Other functions simply require user-level access to a

WebEOC object, such as a status board.

When a method requires a level of administrator access, the method's summary or parameters section

includes this requirement. For example, GetBoardNames requires at least List-level access to the Boards

Manager.

If access to a WebEOC object is all that is needed, the WebEOCCredentials object does not say anything

about admin level access.

A user who is a Full Administrator automatically has full access to all admin managers.

Note: Users who are Sub-Administrators do not have any administrator access to API methods. This means that they are functionally equivalent to regular users, and can only access non-administrator API methods.

7

Methods

Summary

Click the appropriate link in this summary to view details about that method.

Type Name Description

Groups AddGroup

Adds a group to WebEOC. Requires administrator credentials for users and groups.

EditGroup Edits a group's details.

GetGroup Gets a list of all users in a specified group.

GetGroupNames

Gets a list of all the groups in WebEOC. Requires administrator credentials.

DeleteGroup Deletes a group.

Users

Positions AddUser

Adds a new user to WebEOC. Requires administrator credentials.

EditUser Edits a user's details.

AddUserToPosition

Assigns a user to a position. Requires administrator credentials.

RemoveUserFromPosition

Removes a position from a user. Requires administrator credentials.

GetUser Retrieves information for a single user.

GetUserNames

Retrieves all of the user names from a WebEOC system

GetPositions

Returns all of the positions contained within WebEOC. Requires administrator credentials.

GetPositionsForUser

Returns the positions assigned to a user. Requires administrator credentials.

GetUsersByPosition

Returns the users who have a particular position assigned to them. Requires administrator credentials.

8

WebEOC API Technical Guide

Type Name Description

DeleteUser

Deletes a user from WebEOC. Requires administrator credentials.

DeleteUserIfNoPositions

Deletes a user who is not assigned to any positions. Requires administrator credentials.

Incidents AddIncident

Adds an incident to WebEOC. Requires administrator credentials for incidents.

GetIncidents

Gets a list of all the WebEOC incidents available to a particular user.

Boards AddData Adds a new entry to a WebEOC board.

AddRelatedData

Adds a new record to a WebEOC board that is related to a record in a different table.

AddAttachment Attaches a file to an existing board entry.

UpdateData Updates an existing entry in a WebEOC board.

UpdateRelatedData

Updates an existing entry in a board that is related to a record in a different table.

UpdateDataBatch

Adds or updates any number of record entries at one time in a WebEOC board.

GetData

Gets all the entries contained within a WebEOC board.

GetDataByDataId

Retrieves a single, specific entry from a WebEOC board.

GetFilteredData

Gets the entries contained within a WebEOC board that meet certain requirements.

GetUpdatedData

Gets records based on when they were added or last updated.

GetAttachment Retrieves an existing attachment.

GetBoardNames

Gets a list of all the boards in WebEOC. Requires administrator credentials.

9

Methods

Type Name Description

GetInputViews

Gets a list of the input views for a particular board. Requires administrator credentials.

GetDisplayViews

Gets a list of the display views for a particular board. Requires administrator credentials.

GetViewFields

Returns a list of all the fields in an input or display view. Requires administrator credentials.

PostStandardData

This method is currently not used with core WebEOC. It is reserved for future interfaces that post specific standardized data that must be transformed before adding it to a WebEOC board.

Lists SaveList

Saves or renames a WebEOC list. Requires administrator credentials.

SaveListItem

Saves or renames a WebEOC list item. Requires administrator credentials.

GetLists

Retrieves all lists in WebEOC. Requires administrator credentials.

GetListItems

Returns items in a specified list; identifies the list by using its unique identifier. Requires administrator credentials.

GetListItemsByListName

Returns items in a specified list; identifies the list by its name. Requires administrator credentials.

DeleteList

Deletes a WebEOC list. Requires administrator credentials.

DeleteListItem

Deletes a WebEOC list item. Requires administrator credentials.

Miscellaneous Ping

Tests connectivity to the WebEOC instance and correctness of credentials.

10

WebEOC API Technical Guide

Automatic Code Generation

A WSDL file describing the WebEOC API web service is available in the root of the WebEOC virtual

directory.

For example, if the WebEOC server name is MyWebEOCServer and WebEOC is running in the virtual

directory /eoc7, the path to the WSDL would be:

http(s)://MyWebEOCServer/eoc7/api.asmx?wsdl

Many popular languages have utilities for generating SOAP proxy classes by inspecting the WSDL.

The .NET code generator is a command line executable called WSDL.exe and is distributed with the

.NET SDK. With the above WSDL path, WSDL.exe would be invoked as follows:

wsdl /out:WebEOCServiceAPI.cs http://MyWebEOCServer/eoc7/api.asmx?wsdl

Alternatively, proxy classes can be generated directly within Visual Studio by right clicking the project and

selecting Add Web Reference.

Groups

Add a Group

The AddGroup method adds a group to WebEOC and allows you to specify various properties for the

group.

Parameters

This method has the following parameters:

● credentials - WebEOCCredentials object that specifies a user’s access to a WebEOC system.

To use this method, the user must have at least Edit permissions to the Groups Manager.

● groupToAdd – WebEOCGroup object that specifies the group to add to WebEOC.

11

Methods

Example

//Create the API service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Create the WebEOCGroup object

WebEOCGroup groupToAdd = new WebEOCGroup();

groupToAdd.Name = "group1";

groupToAdd.AssignedIncidents = new string[] { "incident1", "incident2" };

groupToAdd.AssignedPositions = new string[] { "EOC Director", "Finance

Section Chief" };

groupToAdd.Comment = "Comment for group1";

groupToAdd.Organizational = true;

//Add the group

api.AddGroup(credentials, groupToAdd);

Edit a Group

The EditGroup method edits an existing group in WebEOC. The group comment, organizational setting,

assigned positions, and assigned incidents can all be changed.

12

WebEOC API Technical Guide

Parameters

The method uses the following parameters:

● credentials - WebEOCCredentials object that specifies a user’s access to a WebEOC

system. To use this method, the user must have at least Edit permissions to the Groups

Manager.

● groupToEdit – WebEOCGroup object that specifies the group to edit in WebEOC.

Example

//Create the API service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Create the WebEOCGroup object.

//We are assuming that a group named "group1" has already been made

//through the user interface or by using the AddGroup method

WebEOCGroup groupToEdit = new WebEOCGroup();

groupToEdit.Name = "group1";

groupToEdit.AssignedIncidents = new string[] { "incident3" };

groupToEdit.AssignedPositions = new string[] { "Liaison Officer" };

groupToEdit.Comment = "Modified comment for group1";

groupToEdit.Organizational = false;

//Edit the existing group

api.EditGroup(credentials, groupToEdit);

13

Methods

Get a Group

The GetGroup method returns a WebEOCGroup object for a specified group name.

Parameters

The method accepts the following parameters:

● credentials - WebEOCCredentials object that specifies a user’s access to a WebEOC

system. To use this method, the user must have at least List permissions to the Groups

Manager.

● groupName – Name of the group to retrieve the associated WebEOCGroup object for.

Example

//Create the API service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Get all group names

WebEOCGroup group = api.GetGroup(credentials, "All");

Get Group Names

The GetGroupNames method returns an array containing all group names on the target WebEOC

system.

Parameter

The method accepts the credentials parameter. This WebEOCCredentials object specifies a user’s

access to a WebEOC system. To use this method, the user must have at least List permissions to the

Groups Manager.

14

WebEOC API Technical Guide

Example

//Create the API service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "webeoc administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Get all group names

string[] groupNames = api.GetGroupNames(credentials);

Delete a Group

The DeleteGroup method deletes an existing group from WebEOC.

Parameters

This method uses the following parameters:

● credentials - WebEOCCredentials object that specifies a user’s access to a WebEOC system.

To use this method, the user must have at least Delete permissions to the Groups Manager.

● groupNameToDelete - Name of the group to delete.

Example

//Create the API service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

15

Methods

credentials.Position = "EOC Director";

//Delete the group

api.DeleteGroup(credentials, "group1");

Users and Positions

Add a User

The AddUser method adds a user to WebEOC.

Parameters

The method has three parameters:

● WebEOCCredentials – User credentials; user must be a User administrator with, at a minimum,

Edit permissions.

● WebEOCUser – Must contain at least the username.

● Password – Password to be assigned to this user.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Create the user object and assign some properties to it

WebEOCUser user = new WebEOCUser();

user.Username = "user1";

16

WebEOC API Technical Guide

user.IsAdministrator = false;

user.IsMultipleUserLogin = true;

user.PrimaryEmail = "[email protected]";

//Add the user to WebEOC with the specified password

api.AddUser(credentials, user, "userpassword");

Edit a User

The EditUser method edits a user’s properties.

Parameters

This method has the following parameters:

● credentials - WebEOCCredentials object that specifies a user’s access to a WebEOC system.

To use this method, the user must have at least Edit permissions to the Users Manager.

● webeocUser - WebEOCUser object that represents a WebEOC user and some of its

properties.

Note: The username cannot be changed using this method.

Example

//Create the API service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Assuming a WebEOC user already exists, named "user1", which was

//added from the user interface or with the AddUser API method,

17

Methods

//then the below code modifies that user with the specified values,

//except for the Username, which cannot be changed.

WebEOCUser user = new WebEOCUser();

user.Username = "user1";

user.Password = "password1";

user.PrimaryEmail = "[email protected]";

user.Color = "ff0000";

user.IsAccountDisabled = false;

user.ChangePasswordAtNextLogin = false;

user.IsAdministrator = false;

user.IsMultipleUserLogin = false;

user.IsDualCommitUser = false;

//Edit the user

api.EditUser(credentials, user);

Add a User to a Position

The AddUserToPosition method assigns a user to a position.

Note: The position must exist in WebEOC prior to this call.

Parameters

This method has three parameters:

● WebEOCCredentials – User credentials; user must be a User Administrator with, at a minimum,

Edit permissions.

● UserName – User to assign to the position.

● Position – Position the user is to be assigned to.

This example adds a new user to WebEOC, followed by assigning that user to a pre-existing position.

18

WebEOC API Technical Guide

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Create the user object and assign some properties to it

//(if the user already exists, this step can be skipped)

WebEOCUser user = new WebEOCUser();

user.Username = "user2";

user.IsAdministrator = false;

user.IsMultipleUserLogin = true;

user.PrimaryEmail = "[email protected]";

//Add the user to WebEOC with the specified password

api.AddUser(credentials, user, "user2password");

//Add the user to specified position

api.AddUserToPosition(credentials, user.Username, "EOC Director");

Remove a User from a Position

The RemoveUserFromPosition method removes a specific position from a user.

19

Methods

Parameters

This method has three parameters:

● WebEOCCredentials – User credentials; user must be a User administrator with, at a minimum,

Edit permissions.

● UserName – User to remove from the position.

● Position – Position name that the user is to be removed from.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Remove user2 from the "EOC Director" position

api.RemoveUserFromPosition(credentials, "user2", "EOC Director");

Get a User

The GetUser method retrieves a WebEOCUser object corresponding to a user that exists in a WebEOC

system.

Parameters

The method has the following parameters:

● credentials - WebEOCCredentials object that specifies a user’s access to a WebEOC system.

To use this method, the user must have at least List permissions to the Users Manager.

● userName – User name for which to retrieve the associated WebEOCUser object.

20

WebEOC API Technical Guide

Example

//Create the API service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Get the account information for a single WebEOC user

WebEOCUser user = api.GetUser(credentials, "user1");

Get Usernames

The GetUserNames method retrieves all of the user names from a WebEOC system.

Parameter

This method uses the credentials parameters. This is the WebEOCCredentials object that specifies a

user’s access to a WebEOC system. To use this method, the user must have at least List permissions to

the Users Manager.

Example

//Create the API service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

21

Methods

//Get the list of all WebEOC user accounts

string[] userNames = api.GetUserNames(credentials);

Get All Positions or Users in WebEOC

Use one of the following methods to get user and/or position information:

● The GetPositions methods returns a list of positions in WebEOC.

● The GetPositionsForUser method returns a list of positions for a specific user.

● The GetUsersByPosition method returns a list of users assigned to a specified position.

Get All Positions

The GetPositions method gets all of the positions in WebEOC.

Parameter

This method uses the WebEOCCredentials parameter. This specifies position credentials. The user must

have at least List permissions to the Users Manager.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Get all of the positions in WebEOC

string[] allPositions = api.GetPositions(credentials);

foreach (string positions in allPositions)

22

WebEOC API Technical Guide

{

Console.WriteLine(position);

}

Get All Positions Assigned to a User

The GetPositionsForUser method gets all of the positions assigned to a user. Administrators have

access to all positions.

Parameters

This method has two parameters:

● WebEOCCredentials – User credentials; user must have at least List permissions to the Users

Manager.

● UserName – Name of the user with the assigned positions.

Note: The example below demonstrates this API method by invoking it with the username of a non-administrator user. By default, a full administrator has access to all positions without the positions needing to be specifically assigned.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Get all of the positions assigned to a non-admin user

string[] positions = api.GetPositionsForUser(credentials, "non-admin user");

foreach (string positionName in positions)

{

23

Methods

Console.WriteLine(positionName);

}

Get All Users Assigned to a Position

The GetUsersByPosition method gets all of the users assigned to a given position. Administrators are

by default considered members of all positions.

Parameters

This method has two parameters:

● WebEOCCredentials – User credentials; user must have at least List permissions to the

Positions Manager.

● PositionName – Name of the position with assigned users.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Get all of the users assigned to the "EOC Director" position

WebEOCUser[] webeocUsers = api.GetUsersByPosition(credentials, "EOC

Director");

foreach (WebEOCUser user in webeocUsers)

{

Console.WriteLine(user.Username);

}

24

WebEOC API Technical Guide

Delete a User

The DeleteUser method deletes a user when that user is assigned to at least one position. If the user is

not currently assigned to a position, use the DeleteUserIfNoPositions method.

Delete a User Assigned to One or More Positions

The DeleteUser method deletes a user who is assigned to at least one position.

Parameters

This method has two parameters.

● WebEOCCredentials – User credentials; user must be a User administrator with Delete

permissions.

● UserName – Username to delete.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Delete user2

api.DeleteUser(credentials, "user2");

Delete a User Who Is Not Assigned to Any Positions

The DeleteUserIfNoPositions method deletes a user who is not assigned to any positions.

25

Methods

Parameters

This method has two parameters.

● WebEOCCredentials – User credentials; user must be a User administrator with Delete

permissions.

● UserName – Username to delete.

If there are no positions assigned to the user, this method deletes the user and returns the Boolean value

"true". If the user is assigned at least one position, the user is not deleted and the Boolean value "false" is

returned.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Delete user2 when the user is not assigned to any positions

api.DeleteUserIfNoPositions(credentials, "user2");

26

WebEOC API Technical Guide

Incidents

Add an Incident

The AddIncident method adds an incident to WebEOC.

Parameters

This method has several parameters:

● WebEOCCredentials – User credentials; user must be an Incidents administrator with, at a

minimum, Edit permissions.

● IncidentName – Name of the incident.

● DateTime – Object that specifies the incident’s creation time.

● Default – Boolean value specifying whether the incident is the default incident.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = newWebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials. Password = "Password";

credentials.Position = "EOC Director;

//Add an incident to WebEOC, set to June 1, 2011,

//not set as the default incident

api.AddIncident(credentials, "incident1", new DateTime(2011, 6, 1), false);

27

Methods

Get the Incidents List

One of the simplest API operations is using the GetIncidents method to retrieve the WebEOC incident

list for a particular user.

Parameter

This method uses only a WebEOCCredentials object. The object is populated with the information for the

appropriate user. It will return an array of incident names.

The incident names are valid possible values for the Incident property for any other calls to the web

service.

Example

//Create the api service object.

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Retrieve the incident array for the user contained

//in the WebEOCCredentials object.

string[] incidents = api.GetIncidents(credentials);

28

WebEOC API Technical Guide

Boards

Add a New Board Entry

The AddData method is used to add a new entry to a board. In this example, a new shelter is added to

the Shelters board.

Parameters

This method has the following parameters:

● WebEOCCredentials – User credentials.

● BoardName – Name of the board to add the data to.

● InputViewName – Input view to use when adding the data.

● XmlData – String of XML data that contains the values to be added to the board.

This method returns an integer value called the dataid. This is the database primary key for the newly

added record. The return value is used when updating this record at a later time. The XML data string

should contain a root element called "data", with children elements matching the WebEOC input view field

names.

For example, the input view for shelters has the following fields:

name status title

address arc contactname

county specialneeds Contactnumber

capacity petfriendly Remarks

XML Example

The input XML data string should look similar to the following:

<data>

<name>City High School</name>

<address>1201 Main St.</address>

<county>Chatham</county>

29

Methods

<capacity>75</capacity>

<status>OPEN</status>

<arc>Yes</arc>

<specialneeds>Yes</specialneeds>

<petfriendly>No</petfriendly>

<title>Director</title>

<contactName>Jack Jones</contactName>

<contactNumber>555-5555</contactNumber>

<Remarks>here are some comments</Remarks>

</data>

All fields are not required in the XML string. Any fields not present in the string generate empty fields in

the new record.

Example

string boardName = "Shelters";

string inputViewName = "Input";

//Build the xml data string

string xmlData = "<data>" +

"<name>City High School</name>" +

"<address>1201 Main St.</address>" +

"<county>Chatham</county>" +

"<capacity>75</capacity>" +

"<status>OPEN</status>" +

"<arc>Yes</arc>" +

"<specialneeds>Yes</specialneeds>" +

"<petfriendly>No</petfriendly>" +

30

WebEOC API Technical Guide

"<title>Director</title>" +

"<contactName>Jack Jones</contactName>" +

"<contactNumber>555-5555</contactNumber>" +

"<Remarks>here are some comments</Remarks>" +

"</data>";

//And post to WebEOC

int dataid = api.AddData(credentials, boardName, inputViewName, xmlData);

Add a Related Board Record

The AddRelatedData method adds a new record to a board and relates it to an existing record. In this

example, a new resident record is added to an existing shelter.

Note: The Shelters board used in this example is not the Shelters board distributed with the WebEOC board installers prior to version 7.4.

The input view for adding new shelter residents (Sheltered) has a foreignkey tag to the Shelters table.

Therefore, each new entry in the Sheltered table should be related to an existing record in the table.

Parameters

This method uses the same parameters as the AddData method, plus two additional parameters for

indicating which table and dataid to relate to:

● WebEOCCredentials – User credentials.

● BoardName – Name of the board to add the data to.

● InputViewName – Input view to use when adding the data.

● XmlData – String of XML data that contains the values to be added to the board.

● RelatedTable – Table that the new record is to be related to.

● RelatedDataId – Identifier of the existing record that the new record is to be related to.

31

Methods

Example

//The board that we are adding data to.

string boardName = "Shelters";

//The input view that we are adding data with.

string inputViewName = "Sheltered";

//The table to relate to. Our new resident

//record should be related to an entry in

//the Shelters Table.

string sheltersTable = "Shelters Table";

//We should already know the data id of the

//shelter to add to. Either saved from initially

//adding the shelter or retrieved through GetData

//or GetFilteredData.

int shelterDataId = 1;

//Build the xml data string

string xmlData = "<data>" +

"<Last_Name>Jones</Last_Name>" +

"<First_Name>Mickey</First_Name>" +

"<dob>03-21-58</dob>" +

"</data>";

//Post the new record. The data id for our

//new resident record will be returned.

newDataId = api.AddRelatedData(credentials, boardName, inputViewName,

xmlData, sheltersTable, shelterDataId);

32

WebEOC API Technical Guide

Add Attachment to a Board Record

The AddAttachment method allows an attachment to be added to a pre-existing board record. The

following example uses the PIO Admin Input view of the Press Release board. This view has an

attachment field in it.

Parameters

This method has several parameters:

● WebEOCCredentials – Credentials of any WebEOC user with access to the board.

● BoardName – Name of the WebEOC board.

● InputViewName – Name of the WebEOC input view.

● AttachmentFieldName – Name of the attachment field; this can be found on the board input

view editor.

● Dataid – Identifier of the post that you are adding the attachment to.

Note: The record must have already been created prior to the AddAttachment call.

● AttachmentFileData – File converted into a byte array.

● AttachmentFileName – Default filename provided to a user when the user saves the file

attachment to a local drive.

Example

//Board with attachment field

string board = "Press Release",

inputViewName = "PIO Admin Input",

AttachmentFieldName = "press_release",

filePath = @"C:\test.jpg";

//dataid of the board post

int dataid = 1;

33

Methods

//Setup to get image in correct format for API call

MemoryStream ms = new MemoryStream();

Image myImage = Image.FromFile(filePath);

myImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);

byte[] image = ms.ToArray();

//API reference and credentials

APIExample.WebEOCAPI.API api = new API();

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

credentials.Incident = "Setup";

//Call API, adding attachment

api.AddAttachment(credentials, board, inputViewName, AttachmentFieldName,

dataid, image, "filename.jpg");

Update an Existing Board Entry

Existing records can be modified using the UpdateData method. In the following example, the shelter

record created in the AddData example is updated.

Parameters

This method takes the following parameters:

● WebEOCCredentials – User credentials.

● BoardName – Name of the board to add the data to.

● InputViewName – Input view to use when adding the data.

● XmlData – String of XML data that contains the values to be added to the board.

34

WebEOC API Technical Guide

● DataId - Identifier created when the record was added; used to specify the record that is to be

updated.

The XML data string is structured the same as for AddData and should supply all the fields contained in

the view.

Note: Updating replaces existing data with the new data specified via this method. For example, when a record was added, it contained twelve fields (per the process described in AddData). If, when the XML data string passed to UpdateData includes only four of those fields, the remaining eight fields are considered empty. Therefore, any existing data in these eight fields is overwritten (removed).

In the example below the status and contactNumber fields are updated to the newly specified values,

and all other fields remain the same.

Example

string boardName = "Shelters";

string inputViewName = "Input";

//Build the xml data string that will be used

//to update the existing record

string xmlData = "<data>" +

"<name>City High School<name>" +

"<address>1201 Main St.</address>" +

"<county>Chatham</county>" +

"<capacity>75</capacity>" +

"<status>CLSD</status>" +

"<arc>Yes</arc>" +

"<specialneeds>Yes</specialneeds>" +

"<petfriendly>No</petfriendly>" +

"<title>Directory</title>" +

"<contactName>Jack Jones</contactName>" +

"<contactNumber>444-4444</contactNumber>" +

"<Remarks>here are some comments</Remarks>" +

35

Methods

"</data>";

//And post to WebEOC

api.UpdateData(credentials, boardName, inputViewName, xmlData, dataid);

Update a Related Board Entry

The UpdateRelatedData method modifies a record that has been related to an existing entry via the

AddRelatedData method. In the following example, an existing shelter resident is being moved to a

different shelter.

Parameters

This method takes the following parameters:

● WebEOCCredentials – User credentials.

● BoardName – Name of the board to add the data to.

● InputViewName – Input view to use when adding the data.

● XmlData – String of XML data that contains the values to be added to the board.

● RelatedTable – Table that the new record is to be related to.

● RelatedDataId – Identifier of an existing record that the new record is to be related to.

Example

//The board that we are modifying.

string boardName = "Shelters";

//The input view that we are using.

string inputViewName = "Sheltered";

//The table to relate to. Our resident record

//should be related to an entry in the Shelters

//Table.

36

WebEOC API Technical Guide

string sheltersTable = "Shelters Table";

//We should already know the data id of the shelter

//to move to. Either saved from initially adding

//the shelter or retrieved through GetData or

//GetFilteredData.

int shelterDataId = 2;

//Our updated data is empty. We’re not changing

//the resident’s personal data.

//Just which shelter record they are related to.

string xmlData = "<data></data>";

//Post the change.

api.UpdateRelatedData(credentials, boardName, inputViewName, xmlData,

sheltersTable, shelterDataId);

Add or Update Multiple Records at One Time

The UpdateDataBatch method allows one or more records to be added or updated in WebEOC at one

time.

Parameters

The method has the following parameters:

● WebEOCCredentials – Any user with access to the board through their group.

● BoardName – Name of the board.

● InputViewName – Name of the input view that the XML data is used in.

● XmlData – One or more records; the <record></record> section can be repeated multiple times.

37

Methods

Read this section to learn about:

● Multiple records

● Main code

● Supporting code - single record; merge records

Multiple Records

Example

<data>

<record>

<xmltag1>data1</xmltag1>

<xmltag2>data2</xmltag2>

<xmltag3>data3</xmltag3>

</record>

</data>

Main Code

The main code adds one or more records to a board, or updates one or more records that already exist.

The example shows the creation of two records.

The third parameter of the buildXMLDataString function takes an integer, which is the dataid of the

record to update. If a zero or a negative number is supplied, a new record is made. If the dataid of an

existing record is supplied, then that record is updated with the new data.

Note: The following example uses the Shelters board, which is an incident-independent board by default. For an incident-independent board, specifying the incident in the WebEOCCredentials object does nothing. For an incident-dependent board, the WebEOCCredentials object must specify an incident.

38

WebEOC API Technical Guide

Example

//Create the api service object

APIExample.WebEOCAPI.API apiReference = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

credentials.Incident = "Setup";

//specify board and input view names

string boardName = "Shelters";

string inputViewName = "Input";

//Make two new XML strings, merge them into a single SML string

String[] concatenatedXMLData = new String[2];

for (int i = 0; i < concantendatedXMLData.Length i++) {

concatenatedXMLData[i] =

XMLBoardParsing.buildXMLDataString(XLBoardParsing.UNIQUE_SHELTERS_XML, i, -

1);

}

String xmlData = merge XMLData(concatenatedXMLData);

//display XML data to be added

System.Console.WriteLine(xmlData);

//Add the two new records

39

Methods

int[] resultDataIds = apiReference.UpdateDataBatch(credentials, boardName,

inputViewName, xmlData);

//Display the retrieved record data

//A display view name has to be added for use by GetDataByDataId

String displayViewName = "Details";

System.Console.WriteLine("The records retrieved are: ");

System.Console.WriteLine(apiReference.GetDataByDataId(credentials, boardName,

displayViewName, resultDataIds[0]));

System.Console.WriteLine(apiReference.GetDataByDataId(credentials, boardName,

displayViewName, resultDataIds[1]));

Supporting Code

The first code example builds a single XML record based on the parameters provided. The example uses

the Shelters board.

The dataid is only included in the generated XML when this is an existing record (that is, the dataid

contains a positive value). Unique records can be made by passing in unique integers for appendText.

Single Record

This first code example builds a single XML record:

public status string buildXMLDataString(int type, int appendText, ind dataID)

{

// if a dataID is greater than 0, add a dataid including it

String appendDataID = "";

if (dataID > 0)

appendDataID = "<dataid>" + dataID + "</dataid>";

switch(type)

{

case UNIQUE_SHELTERS_XML:

40

WebEOC API Technical Guide

string xmlCustomData =

"<data>" +

"<record>" +

appendDataID +

"<label>Label" + appendText + "</label>" +

"<address>Address" + appendText + "</address>" +

"<capacity>75</capacity>" +

"<status>OPEN</status>" +

"<arc>Yes</arc>" +

"<specialneeds>Yes</specialneeds>" +

"<petfriendly>Yes</petfriendly>" +

"<title>Director" + appendText + "</title>" +

"<contactName>Contact" + appendText + "</contactName>" +

"<contactNumber>Number" + appendText + "</contactNumber>" +

"<remarks>Remark" + append Text + "</remarks>" +

"</record>" +

"</data>";

return xmlCustomData;

...

Merge Records

The following supporting code merges any number of XML records:

private String mergeXMLData(String[] separateRecords)

{

String returnedData;

//strip out beginning and ending data tags

for (int i = 0; i < separateRecords.Length; i++)

{

41

Methods

separateRecords[i] = separateRecords[i].Replace("<data>", "");

separateRecords[i] = separateRecords[i].Replace("</data>", "");

}

//build new string with a single starting and ending data tag

returnedData = <data>";

for (int i = 0; < separateRecords.Length; i++)

{

returnedData += separateRecords[i];

}

returnedData += "</data>";

//return XML string

return returnedData;

}

Get Board Data

The GetData method returns an XML string of the data contained within a particular display view of a

board. If the board is:

● Incident independent, all data is returned.

● Incident dependent, only the records entered through the incident included in the WebEOC

credentials object are returned.

Parameters

This method accepts three parameters:

● WebEOCCredentials – User credentials.

● BoardName – Board to retrieve data from.

● DisplayViewName – Specific display view to retrieve data from.

42

WebEOC API Technical Guide

Example

//The board that we are using.

string boardName = "Shelters";

//The display view that we are using.

string displayViewName = "List";

//Get the data.

string results = api.GetData(credentials, boardName, displayViewName);

Example - Returned XML

<data>

<record>

<name>City High School</name>

<address>1201 Main St.</address>

<county>Chatham</county>

<capacity>75</capacity>

<status>OPEN</status>

<arc>Yes</arc>

<specialneeds>Yes</specialneeds>

<petfriendly>No</petfriendly>

<title>Director</title>

<contactName>Jack Jones</contactName>

<contactNumber>555-5555</contactNumber>

<Remarks>here are some comments</Remarks>

</record>

43

Methods

<record>

<name>St. Mary’s Prep</name>

<address>638 East Bay St.</address>

<county>Chatham</county>

<capacity>125</capacity>

<status>OPEN</status>

<arc>No</arc>

<specialneeds>Yes</specialneeds>

<petfriendly>No</petfriendly>

<title>Director</title>

<contactName>Shelly McTavish</contactName>

<contactNumber>555-5555</contactNumber>

<Remarks>here are some remarks</Remarks>

</record>

</data>

Get Board Data by Data Id

The GetDataByDataId is used to retrieve a specific board entry when the data ID for that entry is already

known.

For example, a system interfacing with WebEOC could add a new shelter using the AddData method,

which would return the data ID for the newly created shelter record. The third-party system could use the

retrieved data ID with the GetDataByDataId method to retrieve the current shelter information without

having to create a filter for that shelter.

44

WebEOC API Technical Guide

Parameters

This method accepts four parameters:

● WebEOCCredentials – User credentials.

● BoardName – Board to retrieve data from.

● DisplayViewName – Specific display view to retrieve data from.

● DataId – Identifier for the entry to retrieve.

Example

//The board that we are getting data for.

string boardName = "Shelters";

//The display view that we are using.

string displayViewName = "List";

//The data id

int dataId = 1;

//Get the xml results

string results = api.GetDataByDataId(credentials, boardName, displayViewName,

dataId);

Get Filtered Board Data

The GetFilteredData method retrieves board data similar to the GetData method, but allows filtering

parameters to be specified for the returned data.

Filter Types

This method supports two filter types:

● If a view filter has been created within WebEOC, that filter can be invoked through this method.

● An XML user string can be passed to this method to allow dynamic filtering.

45

Methods

View filters and a user filter can be used at the same time.

Parameters

This method accepts five parameters:

● WebEOCCredentials – User credentials.

● BoardName – Board to retrieve data from.

● DisplayViewName – Specific display view to retrieve data from.

● ViewFilterNames – Array of any view filters to apply to the returned data.

● XmlUserFilter – XML string of data to filter by,

The following two examples call GetFilteredData.

Retrieve Data Using a View Filter

This example retrieves all of the open shelters in the Shelters board by invoking a previously defined view

filter called Open Shelters.

Example

//The board that we are getting data for.

string boardName = "Shelters";

//The display view that we are using.

string displayViewName = "List";

//Set up the view filters array.

string[] viewFilters = new string[] { "Open Shelters"};

//Get the xml results

string results = api.GetFilteredData(credentials, boardName, displayViewName,

viewFilters, null);

46

WebEOC API Technical Guide

Retrieve Data Using an XML User Filter

This example retrieves the data for a specific shelter based on the shelter’s name.

The XML filter to apply looks similar to the following:

<data>

<name>City High School</name>

</data>

Example

//The board that we are getting data for.

string boardName = "Shelters";

//The display view that we are using.

string displayViewName = "List";

//Build the xml filter string

string xmlFilter = "<data><name>City High School</name></data>";

//Get the xml results

string results = api.GetFilteredData(credentials, boardName, displayViewName,

null, xmlFilter);

Get Updated Board Data

The GetUpdatedData method gets all records with an entrydate (system-generated field) on or after a

certain System.DateTime (a .NET object).

Parameters

This method has the following parameters:

● credentials - WebEOCCredentials object that specifies a user’s access to a WebEOC system.

● BoardName – Name of the board that data will be retrieved from.

47

Methods

● DisplayViewName – Any display view of the board that is based on the table containing the

entrydate’s updated data.

● UpdatedTime – All records updated at or after this DateTime will be returned. If desired, this

DateTime can be specified to the second.

Example

//Create the API service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "user1";

credentials.Password = "Password";

credentials.Position = "EOC Director";

credentials.Incident = "incident1";

//Initialize board fields for getting data

string boardName = "Press Release";

string displayViewName = "PIO Display";

//Get all records with an entrydate field having a value on or

//after 11:02:09 AM on October 15, 2014

string updatedData = api.GetUpdatedData(credentials, boardName,

displayViewName, new

DateTime(2014, 10, 15, 11, 2, 9));

//Parse the returned records

System.Xml.XmlDocument updatedDoc = new System.Xml.XmlDocument();

updatedDoc.LoadXml(updatedData);

48

WebEOC API Technical Guide

System.Xml.XmlNodeList updatedRecordNodes =

updatedDoc.SelectNodes("//record");

//Retrieve some useful information from the records

int updatedDataRecordCount = updatedRecordNodes.Count;

Get an Attachment

The GetAttachment method retrieves an existing attachment from WebEOC.

Parameters

This method has the following parameters:

● credentials - WebEOCCredentials object that specifies a user’s access to a WebEOC system.

● boardName – Name of the board containing the attachment.

● displayViewName – Name of the display view containing the attachment field.

● attachmentFieldName – Name of the attachment field.

● dataId – The dataId of the board post containing the attachment.

Returned Object

The GetAttachment method returns an object of type FileAttachment, which has the following

properties:

● FileName – Name of the file.

● ContentType – Type of the returned data. For example: text/plain.

● FileContent – Byte array containing the content of the file.

49

Methods

Example

//Create the API service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

credentials.Incident = "incident1";

//Initialize board fields for setting and getting attachment data

string boardName = "Press Release";

string inputViewName = "PIO Admin Input";

string displayViewName = "PIO Display";

string attachmentFieldName = "press_release";

//Create a board entry that we will add the attachment to

string title = "Attachment entry 1";

string boardXml = String.Format("<data><title>{0}</title></data>", title);

int dataId = api.AddData(credentials, boardName, inputViewName, boardXml);

//Add an attachment

string filePath = @"C:\test1.txt";

byte[] fileData = System.IO.File.ReadAllBytes(filePath);

string fileName = "attached_file.txt";

api.AddAttachment(credentials, boardName, inputViewName, attachmentFieldName,

dataId,

fileData, fileName);

50

WebEOC API Technical Guide

//Get the attachment

FileAttachment fileAttachment = api.GetAttachment(credentials, boardName,

displayViewName, attachmentFieldName, dataId);

Get the WebEOC Board List

The GetBoardNames method returns a list of all boards that exist within WebEOC.

Parameter

This method uses only the WebEOCCredentials object. The user specified by the object must have at

least List permissions to the Boards Manager.

Example

//Create the api service object.

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Retrieve the array of board names.

string[] boards = api.GetBoardNames(credentials);

Get the View List for a Board

The API provides two methods for retrieving the list of views for a particular board. GetInputViews

retrieves all of the input views for a board. GetDisplayViews retrieves all of the display views.

51

Methods

Parameters

Both methods accept the same parameters:

● WebEOCCredentials – User credentials; the user must have at least List permissions to the

Boards Manager.

● BoardName – Name of the board to retrieve the lists of views for.

Example

//Create the api service object.

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

string boardName = "Shelters";

//Retrieve the array of input view names.

string[] inputViews = api.GetInputViews(credentials, boardName);

//Retrieve the array of display view names.

string[] displayViews = api.GetDisplayViews(credentials, boardName);

Get the List of View Fields

The GetViewFields method returns a list of all the fields in a particular view. The view can be a display or

input view.

52

WebEOC API Technical Guide

Parameters

This method accepts the following parameters:

● WebEOCCredentials – User credentials; the user must have at least List permissions to the

Boards Manager.

● BoardName – Name of the board to retrieve fields for.

● ViewName – Specific view to retrieve fields for.

Example

//Create the api service object.

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

string boardName = "Shelters";

string viewName = "Input";

//Retrieve the array of field names.

string[] fields = api.GetViewFields(credentials, boardName, viewName);

Lists

Add or Rename a List or List Item

The SaveList method creates a new WebEOC list, or renames an existing list. The SaveListItem method

creates a new list item or renames an existing item in a list.

53

Methods

Add or Rename a List

The SaveList method creates a new WebEOC list with the provided name. This method is also used to

rename the existing list that you identify by specifying the listId.

Parameters

This method has three parameters:

● WebEOCCredentials – User credentials; user must have at least Edit permissions to the Lists

Manager.

● listId – "0" (zero) if this will be a new list, or the listId of an existing list.

● listName – Name of the list to create, or the new name for the existing list.

The method returns the listId of the list that was created or renamed.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

String listName = "List1";

//Create the list

int listid = api.SaveList(credentials, 0, listName);

Add or Rename a List Item

The SaveListItem command creates a new list item with the specified name. This method is also used to

rename an existing list item. This command also sets or resets the color for the list item.

54

WebEOC API Technical Guide

Parameters

This method has five parameters:

● WebEOCCredentials – User credentials; user must have at least Edit permissions to the Lists

Manager.

● listId – Identifier of a previously created list.

● listItemId – "0" (zero) if this is a new list item, or the listItemId of the existing list item.

● listItemName – Name of the new list item or the new name for the existing list item.

● listItemColor – Six-character hexadecimal value to set or change the list item's color.

Note: ListItemIds are not allocated per list; they are allocated over all WebEOC lists. This means that, if you make three list items in one list followed by three in another list, each of the listItemIds will be distinct from all other listItemIds in the WebEOC install. To determine the listItemIds for a given list, use the GetListItemsByListName method.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Specify the listId of the list that will have

//this listItemId added to it

int listId = 1;

//Create a new list item

int listItemId = api.SaveListItem(credentials, listId, 0, "item1", "FFF000");

55

Methods

Get All Lists in WebEOC

The GetLists method returns all of the lists that exist within WebEOC.

Each DataRow within the returned DataTable contains the list identifier and the list name.

Parameter

This method uses the WebEOCCredentials object. The user must have at least List permissions to the

Lists Manager.

Example

//Create the api service object.

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object.

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Retrieve the DataTable of all lists on the WebEOC system.

DataTable lists = api.GetLists(credentials);

//Each DataRow has the ID of the list and the list name.

System.Console.WriteLine("Lists in the system: ");

foreach (DataRow row in lists.Rows)

{

Console.WriteLine("list identifier: " + row[0].ToString() +

", list name: " + row[1].ToString());

}

56

WebEOC API Technical Guide

Get Items in a List

The GetListItems method returns the items for the specified WebEOC list. You can also obtain this list

using the GetListItemsByListName method.

Get Items Using the List Identifier

The GetListItems method uses the list identifier to identify the appropriate list and returns the items.

Parameters

This method has two parameters:

● WebEOCCredentials – User credentials; user must have at least List permissions to the Lists

Manager.

● listId – Identifier of the list to retrieve; list identifiers can be obtained with the GetLists method.

Each DataRow in the DataTable of list items contains the list item identifier, the list identifier, and the

name of the list item. The following example gets all of the list items for the list identified with listId 1.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

int listId = 1;

//Retrieve the list items by list identifier

DataTable listItems = api.GetListItems(credentials, listId);

foreach (DataRow row in listItems.Rows)

{

57

Methods

Console.WriteLine("list item identifier: " + row[0].ToString() =

", list identifier: " + row[1].ToString() +

", list item name: " + row[2].ToString());

}

Get Items Using the List Name

The GetListItemsByListName method returns the items for the identified WebEOC list.

Parameters

This method has two parameters:

● WebEOCCredentials – User credentials; user must have at least List permissions to the Lists

Manager.

● listName – Name of the list.

Each DataRow in the DataTable of list items contains the list item identifier, the list identifier, and the list

item name. The following example gets list item information based on the list's name.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new APT();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

String listName = "Shelter Status";

//Retrieve the list items by list name

DataTable listItems = api.GetListItemsByListName(credentials, listName);

foreach (DataRow row in listItems.Rows)

58

WebEOC API Technical Guide

{

Console.WriteLine("list item identifier: " + row[0].ToString() =

", list identifier: " + row[1].ToString() +

", list item name: " + row[2].ToString());

}

Delete a List or List Item

The DeleteList method deletes a list from WebEOC, and the DeleteListItem method deletes a single

item from a list.

Delete a List

Parameters

The DeleteList method has two parameters:

● WebEOCCredentials – User credentials; user must be a List administrator with, at a minimum,

Delete permissions.

● listId – Identifier of the list to delete.

Note: Deleting a list using the API functions the same as deleting the list through the WebEOC user interface. In both cases, deleting the list also deletes all of the list items in it.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//The list identifier of the list to be deleted

59

Methods

int listId = 1;

//Delete the list

api.DeleteList(credentials, listId);

Delete a List Item

Parameters

The DeleteListItem method has two parameters:

● WebEOCCredentials – User credentials; user must have at least Edit permissions to the Lists

Manager.

● listItemId – Identifier of the list item to delete.

In this example, the first list item on this WebEOC system is being deleted.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//The specific list item to be deleted

int listItemId = 1;

//Delete the list item

api.DeleteListItem(credentials, listItemId);

60

WebEOC API Technical Guide

Check Connectivity and Credentials in WebEOC

The Ping method provides a convenient way to determine whether WebEOC is accessible and the

credentials being used are correct. If successful, it returns the string "Pong".

Parameter

The method uses the WebEOCCredentials parameter to specify the credentials of an administrator or

non-administrator user.

Example

//Create the api service object

APIExample.WebEOCAPI.API api = new API();

//Create the credentials object

WebEOCCredentials credentials = new WebEOCCredentials();

credentials.Username = "WebEOC Administrator";

credentials.Password = "Password";

credentials.Position = "EOC Director";

//Call the Ping method; the expected result is "Pong"

string result = api.Ping(credentials);

System.Console.WriteLine(result);

61

Glossary A

administrator: A user with permissions that allow them to perform administrative tasks in their

organization's WebEOC system.

API: Application Programming Interface; interface allowing WebEOC and third-party applications to

exchange data.

B board: Status summary used to transmit and share crisis information in real time.

C credentials: User's unique identifiers that allow them to gain access to WebEOC. These include the

user's username and password.

G group: Profile applied to multiple users; provides a quick and easy method of assigning access privileges

to boards, plugins, links, and menus.

I incident: An emergency situation that calls for a response.

L list: Set of choices from which the user can select when entering data for a status board.

P position: Role that individuals take on during emergency response, such as logistics chief, incident

commander, or safety officer. Users can be assigned multiple positions.

S SOAP: Simple Object Access Protocol; specification used for creating web services for use with

WebEOC.

63

Glossary

U user: Individual who has been granted some level of access to their organization's WebEOC system.

V view: Components of a board; the input view is used to add records to the board and the display view

determines how the information appears in the board.

W WSDL: Web Services Description Language; code generation utilities use WSDL to automatically create

help proxy classes and underlying SOAP bindings.

X XML: eXtensible Markup Language

64

Index A

add attachment 33 entry 29 group 11 incident 27 list 53 list item 53 multiple posts 37 post 37 related entry 31 user 16, 18

AddAttachment 33 AddData 29 AddGroup 11 AddIncident 27 AddRelatedData 31 AddUser 16 AddUserToPosition 18 API 1 application

interface 1 attachment

add 33 board post 33 get 49 post 33

authenticate credentials 3, 61 user 3

automatic code generation 7

B

board AddAttachment 33 AddData 29 AddRelatedData 31 data 42 entry 29, 31, 34, 36 get 51 GetAttachment 49 GetBoardNames 51 GetData 42 GetDataByDataId 44 GetDisplayViews 51 GetFilteredData 45 GetInputViews 51 GetUpdatedData 47 GetViewFields 52

installers 7 method 29, 31, 33, 34, 36, 37, 42, 44, 45, 47,

49, 51, 52 post 33, 37 related entry 31 UpdateData 34 UpdateDataBatch 37 UpdateRelatedData 36

C

change group 12 user 17

check connectivity 61 credentials 61

code generate 7

connectivity check 61

credentials authenticate 3, 61 check 61 WebEOC 3

D

data exchange 1 filtered 45 get 42, 44, 45, 47 ID 44 retrieve 42, 44, 45 update 34, 36

delete group 15 list 59 list item 59 user 25

DeleteGroup 15 DeleteList 59 DeleteListItem 59 DeleteUser 25 DeleteUserIfNoPositions 25 display

view 51

E

edit group 12

65

user 17 EditGroup 12 EditUser 17 exchange

data 1

F

field get 52 list 52 view 52

G

generate code 7

get attachment 49 board 51 data 42, 44, 47 fields 52 filtered data 45 group 14 list 28, 51, 52, 56, 57 list items 57 position 22 user 20, 22 username 21 views 51

GetAttachment 49 GetBoardNames 51 GetData 42 GetDataByDataId 44 GetDisplayViews 51 GetFilteredData 45 GetGroup 14 GetGroupNames 14 GetIncidents 28 GetInputViews 51 GetListItems 57 GetListItemsByListName 57 GetLists 56 GetPositions 22 GetPositionsForUser 22 GetUpdatedData 47 GetUser 20 GetUserNames 21 GetUsersByPosition 22 GetViewFields 52 group

add 11 AddGroup 11 change 12 delete 15

DeleteGroup 15 edit 12 EditGroup 12 get 14 GetGroup 14 GetGroupNames 14 method 11, 12, 14, 15 update 12

I

incident add 27 AddIncident 27 GetIncidents 28 list 28 method 27, 28

input view 51

interface application 1

L

list add 53 add item 53 delete 59 delete item 59 DeleteList 59 DeleteListItem 59 fields 52 get 28, 51, 52, 56, 57 get items 57 GetListItems 57 GetListItemsByListName 57 GetLists 56 incident 28 method 53, 56, 57, 59 rename 53 rename item 53 retrieve 28, 56, 57 save 53 save item 53 SaveList 53 SaveListItem 53

M

method board 29, 31, 33, 34, 36, 37, 42, 44, 45, 47,

49, 51, 52 connectivity 61 credentials 61 group 11, 12, 14, 15

66

WebEOC API Technical Guide

incident 27, 28 list 53, 56, 57, 59 overview 7 position 16, 18, 19, 22, 25 setup 3, 5 user 16, 17, 18, 19, 20, 21, 22, 25

methods AddAttachment 33 AddData 29 AddGroup 11 AddIncident 27 AddRelatedData 31 AddUser 16 AddUserToPosition 18 DeleteGroup 15 DeleteList 59 DeleteListItem 59 DeleteUser 25 DeleteUserIfNoPositions 25 EditGroup 12 EditUser 17 GerUsersByPosition 22 GetAttachment 49 GetBoardNames 51 GetData 42 GetDataByDataId 44 GetDisplayViews 51 GetFilteredData 45 GetGroup 14 GetGroupName 14 GetIncidents 28 GetInputViews 51 GetListItems 57 GetListItemsByListName 57 GetLists 56 GetPositions 22 GetPositionsForUser 22 GetUpdatedData 47 GetUser 20 GetUserNames 21 GetViewFields 52 Ping 61 Pong 61 RemoveUserFromPosition 19 SaveList 53 SaveListItem 53 UpdateData 34 UpdateDataBatch 37 UpdateRelatedData 36 WebEOCCredentials 3 WebEOCGroup 5

O

object

WebEOCCredentials 3 WebEOCGroup 5 WebEOCUser 4

P

Ping 61 position

AddUser 16 AddUserToPosition 18 DeleteUser 25 DeleteUserIfNoPositions 25 get 22 GetPositions 22 GetPositionsForUser 22 GetUsersByPosition 22 method 16, 18, 19, 22, 25 remove user 19 RemoveUserFromPosition 19 retrieve 22 user 18, 19, 25

protocol 1

R

record add 29, 37 add related 31 attachment 33 board 29, 31, 33, 34, 36, 37 multiple 37 update 34, 37 update related 36

remove position 19

RemoveUserFromPosition 19 rename

list 53 list item 53

retrieve data 42, 44 filtered data 45 list 28, 56, 57 position 22 user 22

S

save list 53 list item 53

SaveList 53 SaveListItem 53 setting

user 4

67

setup method 3, 5

SOAP 1

U

update data 34, 36 entry 34 group 12 multiple posts 37 post 37 related entry 36 user 17

UpdateData 34 UpdateDataBatch 37 UpdateRelatedData 36 user

add 16, 18 AddUser 16 AddUserToPosition 18 change 17 delete 25 DeleteUser 25 DeleteUserIfNoPositions 25 edit 17 EditUser 17 get 20, 22 GetPositions 22 GetPositionsforUser 22 GetUser 20

GetUserNames 21 GetUsersByPosition 22 method 16, 17, 18, 19, 20, 21, 22, 25 position 18, 19, 25 remove position 19 RemoveUserFromPosition 19 retrieve 22 setting 4 update 17

username get 21

V

view display 51 fields 52 get 51 input 51

W

web service 1 WebEOC

credentials 3 group 5

WebEOCCredentials 3 WebEOCGroup 5 WebEOCUser Object 4 WSDL 1

68