org.mule.modules

mule-module-espn

config

Namespacehttp://www.mulesoft.org/schema/mule/espn
Schema Locationhttp://www.mulesoft.org/schema/mule/espn/current/mule-espn.xsd  (View Schema)
Schema Version1.0
Minimum Mule Version3.2

Module Overview

Mule ESPN API Connector - Connect Mule applications to the ESPN developer API (see http://developer.espn.com/)

Summary

Configuration
<espn:config>
Configure an instance of this module
Message Processors
<espn:get-athletes>
getAthletes
<espn:get-athletes-news>
getAthletesNews
<espn:get-news>
getNews
<espn:get-news-by-id>
getNewsById
<espn:get-news-headlines>
getNewsHeadlines
<espn:get-news-headlines-top>
getNewsHeadlinesTop
<espn:get-sports>
getAllSports
<espn:get-sports-organizing-bodies>
getSportsOrganizingBodies
<espn:get-sports-organizing-groups-divisions>
getSportsOrganizingGroupsDivisions
<espn:get-teams>
getTeams
<espn:get-teams-news>
getTeamsNews

Configuration

To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:espn="http://www.mulesoft.org/schema/mule/espn"
      xsi:schemaLocation="
               http://www.mulesoft.org/schema/mule/core
               http://www.mulesoft.org/schema/mule/core/current/mule.xsd
               http://www.mulesoft.org/schema/mule/espn
               http://www.mulesoft.org/schema/mule/espn/current/mule-espn.xsd">

      <!-- here goes your flows and configuration elements -->

</mule>

This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries its own name.

Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.

Attributes
TypeNameDefault ValueDescriptionJava TypeMIME TypeEncoding
xs:string name Optional. Give a name to this configuration so it can be later referenced.
xs:string apiKey apiKey provided by ESPN during api registration process

Message Processors

<espn:get-athletes>

getAthletes

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
resource ESPN resource (i.e. /sports/baseball/mlb) String */* UTF-8
athleteId Optional. ESPN player id String */* UTF-8
dates Optional. ESPN dates values (year) for requested data (i.e. 2011, 2012, etc...) String */* UTF-8
group Optional. ESPN group (integer) allows filtering by "group" or division String */* UTF-8
enable Optional. ESPN optional flag to enable specific info (comma separated string) valid values: [stats|logos|notes|competitors] String */* UTF-8
seasonType reg Optional. ESPN season type accepts pre/reg/post for preseason, regular and postseason respectively String */* UTF-8
language en Optional. ESPN lang - valid values include 'en' (English) and 'es' (Spanish) String */* UTF-8
limit 50 Optional. Used to limit the number of results returned String */* UTF-8
offset 0 Optional. Used for pagination (i.e. 11 will start with the 11th entry in the response) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String representing athlete data (can be JSON or XML depending on 'accept' parameter)
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error

<espn:get-athletes-news>

getAthletesNews

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
resource ESPN resource (i.e. /espnw) String */* UTF-8
athleteId ESPN identifier for a particular player/athlete. String */* UTF-8
dates Optional. Integer in the form of "yyyymmdd" to get news for a particular date. String */* UTF-8
insider yes Optional. ESPN content to be included, valid values: yes, no, only String */* UTF-8
language en Optional. ESPN lang - valid values include 'en' (English) and 'es' (Spanish) String */* UTF-8
limit 50 Optional. Used to limit the number of results returned String */* UTF-8
offset 0 Optional. Used for pagination (i.e. 11 will start with the 11th entry in the response) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String Stories about a particular player/athlete (can be JSON or XML depending on 'accept' parameter).
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error

<espn:get-news>

getNews

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
resource ESPN resource (i.e. /espnw) String */* UTF-8
dates Optional. Integer in the form of "yyyymmdd" to get news for a particular date. String */* UTF-8
insider yes Optional. ESPN content to be included, valid values: yes, no, only String */* UTF-8
language en Optional. ESPN lang - valid values include 'en' (English) and 'es' (Spanish) String */* UTF-8
limit 50 Optional. Used to limit the number of results returned String */* UTF-8
offset 0 Optional. Used for pagination (i.e. 11 will start with the 11th entry in the response) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String Representing a stream of all news for current date (can be JSON or XML depending on 'accept' parameter).
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error Thrown in the event of a communications error

<espn:get-news-by-id>

getNewsById

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
resource ESPN resource (i.e. /espnw) String */* UTF-8
newsId Optional. ESPN specific story identifier String */* UTF-8
dates Optional. Integer in the form of "yyyymmdd" to get news for a particular date. String */* UTF-8
insider yes Optional. ESPN content to be included, valid values: yes, no, only String */* UTF-8
language en Optional. ESPN lang - valid values include 'en' (English) and 'es' (Spanish) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String represents news story identified by input parameter newsId (can be JSON or XML depending on 'accept' parameter).
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error Thrown in the event of a communications error

<espn:get-news-headlines>

getNewsHeadlines

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
resource ESPN resource (i.e. /espnw) String */* UTF-8
insider yes Optional. ESPN content to be included, valid values: yes, no, only String */* UTF-8
language en Optional. ESPN lang - valid values include 'en' (English) and 'es' (Spanish) String */* UTF-8
limit 50 Optional. Used to limit the number of results returned String */* UTF-8
offset 0 Optional. Used for pagination (i.e. 11 will start with the 11th entry in the response) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String ESPN news headlines (can be JSON or XML depending on 'accept' parameter).
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error Thrown in the event of a communications error

<espn:get-news-headlines-top>

getNewsHeadlinesTop

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
resource ESPN resource (i.e. /espnw) String */* UTF-8
insider yes Optional. ESPN content to be included, valid values: yes, no, only String */* UTF-8
language en Optional. ESPN lang - valid values include 'en' (English) and 'es' (Spanish) String */* UTF-8
region us Optional. Can be used in conjunction with the lang query string parameter to return focused headlines for a particular region, where available. String */* UTF-8
limit 50 Optional. Used to limit the number of results returned String */* UTF-8
offset 0 Optional. Used for pagination (i.e. 11 will start with the 11th entry in the response) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String Top stories as shown on ESPN.com home page. Only applicable to /sports resource (can be JSON or XML depending on 'accept' parameter).
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error

<espn:get-sports>

getAllSports

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
limit 50 Optional. Used to limit the number of results returned String */* UTF-8
offset 0 Optional. Used for pagination (i.e. 11 will start with the 11th entry in the response) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String List of all sports currently supported in the ESPN API (can be JSON or XML depending on 'accept' parameter).
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error

<espn:get-sports-organizing-bodies>

getSportsOrganizingBodies

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
sport ESPN sport name String */* UTF-8
limit 50 Optional. Used to limit the number of results returned String */* UTF-8
offset 0 Optional. Used for pagination (i.e. 11 will start with the 11th entry in the response) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String returns a reference to all organizing bodies, or leagues (e.g. MLB) that are supported within a sport (e.g. baseball) (can be JSON or XML depending on 'accept' parameter).
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error

<espn:get-sports-organizing-groups-divisions>

getSportsOrganizingGroupsDivisions

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
sport ESPN sport name String */* UTF-8
league ESPN league abbreviation (organizing body) String */* UTF-8
limit 50 Optional. Used to limit the number of results returned String */* UTF-8
offset 0 Optional. Used for pagination (i.e. 11 will start with the 11th entry in the response) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String returns information for all groups/divisions that make up an organizing body (i.e. MLB) (can be JSON or XML depending on 'accept' parameter).
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error

<espn:get-teams>

getTeams

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
resource ESPN resource (i.e. /sports/baseball/mlb) String */* UTF-8
teamId Optional. ESPN team identifier String */* UTF-8
enable Optional. ESPN optional flag to enable specific info (comma separated string) valid values: [venues|stats|roster|leaders] String */* UTF-8
groups Optional. ESPN group (integer) allows filtering by "group" or division String */* UTF-8
language en Optional. ESPN lang - valid values include 'en' (English) and 'es' (Spanish) String */* UTF-8
limit 50 Optional. Used to limit the number of results returned String */* UTF-8
offset 0 Optional. Used for pagination (i.e. 11 will start with the 11th entry in the response) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String representing team data (can be JSON or XML depending on 'accept' parameter)
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error

<espn:get-teams-news>

getTeamsNews

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
resource ESPN resource (i.e. /espnw) String */* UTF-8
teamId ESPN identifier for a particular team. String */* UTF-8
dates Optional. Integer in the form of "yyyymmdd" to get news for a particular date. String */* UTF-8
insider yes Optional. ESPN content to be included, valid values: yes, no, only String */* UTF-8
language en Optional. ESPN lang - valid values include 'en' (English) and 'es' (Spanish) String */* UTF-8
limit 50 Optional. Used to limit the number of results returned String */* UTF-8
offset 0 Optional. Used for pagination (i.e. 11 will start with the 11th entry in the response) String */* UTF-8
accept application/json Optional. Used when you can not set the Accepted header (i.e. application/json, text/xml) String */* UTF-8
Returns
Return Type Description
String String Stories about a particular team (can be JSON or XML depending on 'accept' parameter).
Exception Payloads
Payload ClassDescription
IOException Thrown in the event of a communications error

Message Sources

Transformers