D4H API

The D4H API (Application Programmer Interface) is a powerful way to access and interoperate with your organization’s D4H data, and enhance your organization’s D4H usage of it with your own developments.

For example you can create your own mobile application for D4H (in additional to the D4H mobile applications, that use the API.) That, or you can craft your own simple scripts, e.g. to provide a custom quiz to your users via the whiteboard.

The simplest way to get started is:

A more flexible (but marked as experimental, and quite likely soon changing) approach is to implement a user “login”, to gather a token on demand. Note: This isn’t quite as simple as it first appears, it is two step not one. ( When we log in to D4H first with an account it is second our membership in an organization/team that we then use for most API calls, and some accounts are members of multiple teams. ) The authentication API grants an account token, and to call the main APIs one needs to use the account token to acquire a membership token from that account token. (The generated token above – from the team website – is already a membership token.)

Once you have a working token you can access most of the team data; and update some.

  • Activities (past and future)
  • Duty records
  • Member records
  • Groups
  • Equipment (and more)
  • Tasks
  • … and more

What do you want your D4H data to do?

You might want to create a simple an app or webpage to allow your membership to submit maintenance reports your way, or you might want to display call statistics or some recent incident information (or available tasks) on a display in your building. The D4H API allows you to decide what is important to you, and enhance D4H towards that goal. (I’d love to hear your thoughts and ideas. Let me know.)

Powerful, but still ‘Work In Progress’, I hope…

Much as the D4H API is very powerful, the API is incomplete in a few key areas: incident updating, qualifications, tags, custom fields, and more.

Hopefully those will be coming because without them activities can be created, but not updated in any way (not adding a location, a tag, a description, nothing.) This limits any field-based tools for incidents.

No access to qualifications means we cannot create our own qualification reminder systems, and qualifications (we have many tens for every member) are a key challenge for our membership.

Response Utilities Android version 1.0.16

A new release of Response Utilities for D4H on Android is on Google Play. Version 1.0.16.

It contains improvements for Upcoming where attendance is displayed inline with the activity, and can be used to filter from the user’s perspective: all activities, Mine (ones the user is attending or requested to attend), Attending or Requested. Use this to more easily track down the upcoming activity you are looking for.

Upcoming Activities on Android

Improvements in Recent Activities include filtering by activity type: all activities, just incidents, just exercises or just events. Use this to more easily track down the recent activity you are looking for.

Recent Activities on Android

Check out this version of Response Utilities for D4H on Android.

Response Utilities for D4H on iOS. Version 1.0.3 released…

A release of Response Utilities 1.0.3. is rolling out. It releases a number of large and small improvements, and a few additions.

What’s New:
– Improved interface for upcoming and recent activities, and improved workflow for marking attendance. Activities are color coded to match the D4H activity colors. Color coding allows for and easier visual scan.

– “Off Duty” interface now includes an options for “Team” as well as for this “Member”, so overhead can more easily view team status (and team members can set their availability) when on the go.

– Integration into iOS Spotlight Search. In the iOS search bar you can find for members by name (or reference, or position) to quickly launch the application and provide a view of that member. Think of this as integrating D4H data into the phone or device’s contacts.

– “Whiteboard” support allows you to view (and add to) entries on the whiteboard. Share messages with others in the agency, from the field. (Perhaps implement a quiz on your whiteboard.)

Activities can now be shared with other responders via a link into D4H. Allowing communication around an incident or exercise, as needed, without taking data out of D4H.

– More details have been added to the member view. Viewing a member now shows:

  • The member’s upcoming “off duty” status, if any set.
  • The member’s recent activities; incidents, exercises, events.
  • The member’s groups.
  • Now: Links to their profile on D4H and qualification card on D4H.

This extended member view allows a member to check themselves quickly, but also allows overhead and/or administration to check on a member.

– This release adds a number of links into D4H website, to ease navigation on the mobile website.

Learn more about Response Utilities for D4H.

D4H Whiteboard

The D4H whiteboard is a great way to get information out to the members of your organization. Some might not check email, and maybe you don’t wish to “spam” by sending to all, but adding a whiteboard message gets to people who log in to D4H on a regular basis. (We used it recently to remind about our annual SCBA mask fit testing.)

Adding a message (marked important or not) is a great way to get to the top of the D4H dashboard:

When we don’t have more pressing postings to make, we’ve chosen to offer quiz questions on our whiteboard as a fun way to keep content fresh in mind, and keep our membership engaged. We (with we being Coal Creek Canyon Fire Rescue) provide response for structure fire, wildland fire, rescue (including automobile), medical (as a BLS agency), hazardous materials, and (as we learned in 2013) other incidents, such as floods. We also assist with search and rescue (having mountainous state parks in our district.) We have a lot to remember, and quizzes are a good way to keep things top of mind.

We used a spreadsheet to gather questions and a simple ruby script (run automatically daily against the D4H APIs) to post the questions and answers. The script takes the day of the year and combines that with the number of quiz questions to pick today’s quiz question and yesterday’s answer, and posts both.

 #
 #  A snippet of the script, to add a whiteboard entry...
 #
 wuri = URI('https://api.d4h.org/v2/team/whiteboard')
 areq = Net::HTTP::Post.new(wuri)
 areq['Authorization'] = 'Bearer ___________'
 
 areq.set_form_data({'text' => formatted_question, 'enddate' => question_days_ahead_formatted}, '&')
        
 ares = Net::HTTP.start(wuri.hostname, 
                   wuri.port, 
                   :use_ssl => true) {|http|
   http.request(areq)
 }

You can view the Whiteboard in D4H’s MyD4H mobile application. Additionally, here is how the Whiteboard looks in Response Utilities for D4H

Working with D4H groups

Some response teams use mailing lists to communicate with their members, and some create mailing lists per “group” (e.g. officers, leadership, etc.) within their organization, including for qualification groups; divers, drone pilots, EMTs, etc. etc.

Using groups within D4H allows you to reference members by name (their profile) and only have to manage the email address once within D4H, not once per mailing list. You can view members in a group and/or the groups a member is within. As things change (and things continually change; members retire, members get qualified and/or promoted) you can easily maintain D4H groups accordingly.

In D4H you can create as few or as many groups as you like, naming them as suits your purpose. You can create a Dive Team group, an Officers group, a per Station group, as required. You can set requirements on groups (ensuring you have a given number of such members on duty) and you can collaborate with groups. D4H allows you to message a group, sending to only those within that group.

Using groups make D4H more valuable for your organization.

Response Utilities, our mobile application for D4H allows you to quickly/easily view members within groups, and also send email and/or messages (if all members of the group have a mobile phone number registered with D4H) to all members of a group from anywhere you need. (See communications for how.)

Reviewing activities…

Response Utilities allows access to your agency’s incident and exercise information. Look at past incidents and their details, look at past training exercises (or events) and view attendance.

Were you active on the incident but your participation failed to get recorded? Did the report writer mishear details over the radio and hence misreport apparatus or important details of the response? Did you not get JPR (job performance review) credit from an exercise?

The more personnel that review past incidents – and soon after they occur – the more accurate the reports will be. That helps you, and the whole organization.

Use Response Utilities to check the time of the incident or exercise, as well as the duration. Check participation, including a quick scan of participants faces. (The current user is shown first, otherwise those with identified roles – e.g. command or instructor – come first.) check if the activity is still draft (shown as blank below) or has been published.