Communities API

Overview
Version: 1.0

The Communities API is used to create top comments on a bet and to delete, read, like or flag comments. The Communities API lets William Hill customers comment on their own bet. It will be shown on their profile and on their followers feed. Only customers that have placed a bet can publish a comment. As soon as customers place a bet, they can create a comment using the information on the bet receipt. Customers can flag inappropriate comments to moderators at William Hill Customer Services department who will review. If the comment is deemed inappropriate Customer Services will remove it.
Summary
MethodNameDescriptionResource
getCommentsByIdReads a single comment, so you can display it in your application.https://sandbox.whapi.com/v1/communities/comments/{id}
deactivateCommentDeactivates a previously created comment.https://sandbox.whapi.com/v1/communities/comments/{id}
flagCommentFlags an inappropriate comment for review by a moderator.https://sandbox.whapi.com/v1/communities/comments/{id}/flag
unflagCommentDeletes a flag on a comment.https://sandbox.whapi.com/v1/communities/comments/{id}/flag
likeCommentCreates a like on a comment. You cannot flag or like your own comment although it is possible to attempt to do this with the current API functionality. Such an attempt will not result in a flag or a like being added to the customer's own comment. Note that, the system response appears successful to the end user but your application needs to be designed in a way that does not allow customers to flag or like their own comments.https://sandbox.whapi.com/v1/communities/comments/{id}/like
unlikeCommentDeletes a like on a comment.https://sandbox.whapi.com/v1/communities/comments/{id}/like
createCommentOnOutcomeIdCreates a comment against a bet, profile and selection so that you can build functionality in your application that allows customers to create a comment. Note that, it is possible for customers to place a comment against an outcome with the same bet Id. However, this should NOT be done, only one comment is allowed against a single outcome and bet Id combination. Therefore, your application needs to be designed in such a way as not to allow the customer to place a comment against an outcome with same bet Id more than once. The API does not check if the bet ID belongs to the customer or not and if the price is correct or not.https://sandbox.whapi.com/v1/communities/comments/me/outcomes/{id}
getAllCommentbyProfileIdReads active or winning comments on a specific profile so that you can build functionality in your application to display tips.https://sandbox.whapi.com/v1/communities/comments/profiles/{id}
getAllMyCommentsGets a list of all comments on my profile.https://sandbox.whapi.com/v1/communities/comments/profiles/me
getTopOutcomesReads a list of the top tipper outcomes (top tipped selections).https://sandbox.whapi.com/v1/communities/comments/outcomes/top
getAllMyFollowingsCommentsReads a list of all comments on my followings' profiles.https://sandbox.whapi.com/v1/communities/comments/profiles/me/followings
ResourcesExpand AllCollapse All
getCommentsById()
Reads a single comment, so you can display it in your application.
Request Example
GET /v1/communities/comments/{id} HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
Request Parameters
template parameters
NameTypeDescription
idstring
(required)
The unique identifier of the comment.
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstring
(required)
Another unique identifier for your application. The secret must never be sent over HTTP.
Response Description
whoCommunities
Object Name Type Constraints Optional Description
element comment - Exactly one child node No Node
comment
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The id of the comment
element type Integer type No The type of the comment
element bet id Integer [0-9]+ No The unique identifier of the bet
element status Character A|W|L No The status of the comment: Active, Winning, Losing
element createdDateTimeZoned DateTime ISO 8601 No The timestamp when the comment was created
element text String Characters allowed: A-Z, a-z, 0-9 max 900 characters No The text content of the comment
element isFeatured Character Y|N No Indicates if the comment is featured or not.
element isFlagged String Y|N Yes Indicates if this comment is flagged by the requester.
element isLiked String Y|N Yes Indicates if this comment is liked by the requester.
node event Node Exactly one child node No Event node
event
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the event
attribute sportId Integer [0-9]+ No The unique identifier of the sport
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the event
node market Node Exactly one child node No Market node
market
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the market
element name String Characters allowed: A-Z, a-z, 0-9 No Name of the market
element outcome - Exactly one child node No Node
outcome
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the outcome
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the outcome
element status Character A|S No The status of the event: Active or Suspended
element numLikes Integer [0-9]+ No The number of likes on the outcome
element displayStatus Character A|I No The displayStatus effectively shows whether the comment can be displayed or not based on the status of the event/market/selection it belongs to. If any of those are suspended or settled, then the displayStatus will change to INACTIVE.
element startingPrice Character Y Yes Indicates if the price type of the outcome is a starting price.
node livePrice Node Zero or one node Yes LivePrice node
livePrice
Object Name Type Constraints Optional Description
element priceNum Integer [0-9]+ Yes When the odds are shown in simple fractions this is the numerator of the fraction, for example 2 in 2/5.
element priceDen Integer [0-9]+ Yes When the odds are shown in simple fractions this is the denominator of the fraction, for example 5 in 2/5.
element priceFrac fractions [0-9]+/[1-9][0-9]+ Yes This field shows the odds in simple fractions.
element priceDec Double [0-9]+.[0-9]* Yes This field shows the odds in decimal.
element priceUS Integer [0-9]+ Yes This field shows the odds in format used in the USA.
ResponsesExpand AllCollapse All
Status: 200 (Ok) - Success - Comment read
Representations
application/xml
<whoCommunities>
    <comment id="12345" type="tip">
       <betId>6566</betId>
       <status>A|W|L</status>                                                       
       <createdDateTimeZoned>2014-02-12T13:07:42Z</createdDateTimeZoned>
       <text>This is a winner for sure!</text>
       <isFeatured>Y|N</isFeatured>
       <event id="115545" sportId="9">
          <name>Louise Ascot 15:00</name>
          <market id="5527758">
             <name>Win</name>
             <outcome id="11401422">
                <name>Selection 4</name>
                <status>A|S</status>                                            
                <numLikes>234</numLikes>
                <displayStatus>A|I</displayStatus>                               
                <startingPrice>Y</startingPrice>
                <livePrice>
                   <priceNum>15</priceNum>
                   <priceDen>4</priceDen>
                   <priceFrac>15/4</priceFrac>
                   <priceDec>4.75</priceDec>
                   <priceUS>375</priceUS>
                </livePrice>
             </outcome>
          </market>
       </event>
    </comment>
</whoCommunities>
application/json
{  
  "whoCommunities": {
    "comment": {
      "id": "12345W",
      "type": "tip",
      "betId": "6566",
      "status": "A|W|L",
      "createdDateTimeZoned": "2014-02-12T13:07:42Z",
      "text": "This is a winner for sure!",
      "isFeatured": "Y|N",
      "event": {
        "id": "115545",
        "name": "Louise Ascot 15:00",
        "sportId": "9",
        "market": {
          "id": "5527758",
          "name": "Win",
          "outcome": {
            "id": "11401422",
            "name": "Selection 4",
            "status": "A|S",
            "numLikes": "234",
            "displayStatus": "A|I",
            "startingPrice": "Y",
            "livePrice": {
              "priceNum": "15",
              "priceDen": "4",
              "priceFrac": "15/4",
              "priceDec": "4.75",
              "priceUS": "375"
            }
          }
        }
      }
    }
  }
}
Status: 400 (Bad Request) - Fault 10070 - No {id} for comment
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10070</faultCode>
      <faultString>Missing request parameter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10070",
      "faultString": "Missing request parameter",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 30500 - No comment found for {id}
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30500</faultCode>
      <faultString>No comment found for id</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30500",
      "faultString": "No comment found for id",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - {id} in template is not a valid number
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request paramter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request paramter",
      "faultName": "id"
    }
  }
}
deactivateComment()
Deactivates a previously created comment.
Request Example
PUT /v1/communities/comments/{id} HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-ticket: tgtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request Parameters
template parameters
NameTypeDescription
idstring
(required)
The unique identifier of the comment.
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstring
(required)
Another unique identifier for your application. The secret must never be sent over HTTP.
who-ticketstring
(required)
The authentication ticket associated with the user session.
ResponsesExpand AllCollapse All
Status: 204 (No Content) - Success - Tip deleted (Set inactive)
Status: 400 (Bad Request) - Fault 10071 - Invalid tipId for my profile
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request parameter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request parameter",
      "faultName": "id"
    }
  }
}
flagComment()
Flags an inappropriate comment for review by a moderator.
Request Example
POST /v1/communities/comments/{id}/flag HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-ticket: tgtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request Parameters
template parameters
NameTypeDescription
idstring
(required)
The unique identifier of the comment.
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstring
(required)
Another unique identifier for your application. The secret must never be sent over HTTP.
who-ticketstring
(required)
The authentication ticket associated with the user session.
ResponsesExpand AllCollapse All
Status: 204 (No Content) - Success - Comment flagged by me
Status: 400 (Bad Request) - Fault 10070 - No {commentId} in template
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10070</faultCode>
      <faultString>Missing request parameter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10070",
      "faultString": "Missing request parameter",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 30500 - No comment found for {commentId}
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30500</faultCode>
      <faultString>No comment found for id</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30500",
      "faultString": "No comment found for id",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - {commentId} in template is not a valid number
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request paramter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request paramter",
      "faultName": "id"
    }
  }
}
unflagComment()
Deletes a flag on a comment.
Request Example
DELETE /v1/communities/comments/{id}/flag HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-ticket: tgtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request Parameters
template parameters
NameTypeDescription
idstring
(required)
The unique identifier of the comment.
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstring
(required)
Another unique identifier for your application. The secret must never be sent over HTTP.
who-ticketstring
(required)
The authentication ticket associated with the user session.
ResponsesExpand AllCollapse All
Status: 204 (No Content) - Success - Comment unliked by me
Status: 400 (Bad Request) - Fault 10070 - No {commentId} in template
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10070</faultCode>
      <faultString>Missing request parameter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10070",
      "faultString": "Missing request parameter",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 30500 - No comment found for {commentId}
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30500</faultCode>
      <faultString>No comment found for id</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30500",
      "faultString": "No comment found for id",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - {commentId} in template is not a valid number
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request paramter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request paramter",
      "faultName": "id"
    }
  }
}
likeComment()
Creates a like on a comment. You cannot flag or like your own comment although it is possible to attempt to do this with the current API functionality. Such an attempt will not result in a flag or a like being added to the customer's own comment. Note that, the system response appears successful to the end user but your application needs to be designed in a way that does not allow customers to flag or like their own comments.
Request Example
POST /v1/communities/comments/{id}/like HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-ticket: tgtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/x-www-form-urlencoded
Request Parameters
template parameters
NameTypeDescription
idstring
(required)
The unique identifier of the comment.
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstring
(required)
Another unique identifier for your application. The secret must never be sent over HTTP.
who-ticketstring
(required)
The authentication ticket associated with the user session.
ResponsesExpand AllCollapse All
Status: 204 (No Content) - Success - Comment liked by me
Status: 400 (Bad Request) - Fault 10070 - No {commentId} in template
Representations
application/xml
<whoFaults>
 <fault>
    <faultCode>10070</faultCode>
    <faultString>Missing request parameter</faultString>
    <faultName>id</faultName>
 </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10070",
      "faultString": "Missing request parameter",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 30500 - No comment found for {commentId}
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30500</faultCode>
      <faultString>No comment found for id</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30500",
      "faultString": "No comment found for id",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - {commentId} in template is not a valid number
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request paramter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request paramter",
      "faultName": "id"
    }
  }
}
unlikeComment()
Deletes a like on a comment.
Request Example
DELETE /v1/communities/comments/{id}/like HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-ticket: tgtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request Parameters
template parameters
NameTypeDescription
idstring
(required)
The unique identifier of the comment.
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstring
(required)
Another unique identifier for your application. The secret must never be sent over HTTP.
who-ticketstring
(required)
The authentication ticket associated with the user session.
ResponsesExpand AllCollapse All
Status: 204 (No Content) - Success - Comment unliked by me
Status: 400 (Bad Request) - Fault 10070 - No {commentId} in template
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10070</faultCode>
      <faultString>Missing request parameter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10070",
      "faultString": "Missing request parameter",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 30500 - No comment found for {commentId}
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30500</faultCode>
      <faultString>No comment found for id</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30500",
      "faultString": "No comment found for id",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - {commentId} in template is not a valid number
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request paramter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request paramter",
      "faultName": "id"
    }
  }
}
createCommentOnOutcomeId()
Creates a comment against a bet, profile and selection so that you can build functionality in your application that allows customers to create a comment. Note that, it is possible for customers to place a comment against an outcome with the same bet Id. However, this should NOT be done, only one comment is allowed against a single outcome and bet Id combination. Therefore, your application needs to be designed in such a way as not to allow the customer to place a comment against an outcome with same bet Id more than once. The API does not check if the bet ID belongs to the customer or not and if the price is correct or not.
Request Example
POST /v1/communities/comments/me/outcomes/123?text=This%20is%20a%20winner%20for%20sure%21&betId=99984554&linkedId=123&priceNum=15&priceDen=6 HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-ticket: tgtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/xml
Request Parameters
template parameters
NameTypeDescription
idstring
(required)
The id of the outcome.
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstring
(required)
Another unique identifier for your application. The secret must never be sent over HTTP.
who-ticketstring
(required)
The authentication ticket associated with the user session.
query parameters
NameTypeDescription
textstring
(required)
Indicates if the price type of the outcome is a starting price.
betIdstring
(required)
The betId your want to place your tip
linkedIdstringThe linkedId of the event of your comment
priceNumstringWhen the odds are shown in simple fractions this is the numerator of the fraction, for example 2 in 2/5.
priceDenstringWhen the odds are shown in simple fractions this is the denominator of the fraction, for example 5 in 2/5.
startingPricestring
options:
Y,
Indicates if the price type of the outcome is a starting price.
Response Description
whoCommunities
Object Name Type Constraints Optional Description
element comment - Exactly one child node No Node
comment
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The id of the comment
element type Integer type No The type of the comment
element bet id Integer [0-9]+ No The unique identifier of the bet
element status Character A|W|L No The status of the comment: Active, Winning, Losing
element createdDateTimeZoned DateTime ISO 8601 No The timestamp when the comment was created
element text String Characters allowed: A-Z, a-z, 0-9 max 900 characters No The text content of the comment
element isFeatured Character Y|N No Indicates if the comment is featured or not.
element isFlagged String Y|N Yes Indicates if this comment is flagged by the requester.
element isLiked String Y|N Yes Indicates if this comment is liked by the requester.
node event Node Exactly one child node No Event node
event
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the event
attribute sportId Integer [0-9]+ No The unique identifier of the sport
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the event
node market Node Exactly one child node No Market node
market
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the market
element name String Characters allowed: A-Z, a-z, 0-9 No Name of the market
element outcome - Exactly one child node No Node
outcome
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the outcome
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the outcome
element status Character A|S No The status of the event: Active or Suspended
element numLikes Integer [0-9]+ No The number of likes on the outcome
element displayStatus Character A|I No The displayStatus effectively shows whether the comment can be displayed or not based on the status of the event/market/selection it belongs to. If any of those are suspended or settled, then the displayStatus will change to INACTIVE.
element startingPrice Character Y Yes Indicates if the price type of the outcome is a starting price.
node livePrice Node Zero or one node Yes LivePrice node
livePrice
Object Name Type Constraints Optional Description
element priceNum Integer [0-9]+ Yes When the odds are shown in simple fractions this is the numerator of the fraction, for example 2 in 2/5.
element priceDen Integer [0-9]+ Yes When the odds are shown in simple fractions this is the denominator of the fraction, for example 5 in 2/5.
element priceFrac fractions [0-9]+/[1-9][0-9]+ Yes This field shows the odds in simple fractions.
element priceDec Double [0-9]+.[0-9]* Yes This field shows the odds in decimal.
element priceUS Integer [0-9]+ Yes This field shows the odds in format used in the USA.
ResponsesExpand AllCollapse All
Status: 200 (Ok) - Success - Comment created
Representations
application/xml
<whoCommunities>
  <comment id="12345" type="tip">
    <betId>6566</betId>
    <status>A|W|L</status>                                                       
    <createdDateTimeZoned>2014-02-12T13:07:42Z</createdDateTimeZoned>
    <text>This is a winner for sure!</text>
    <isFeatured>Y|N</isFeatured>
    <event id="115545" sportId="9">
        <name>Louise Ascot 15:00</name>
        <market id="5527758">
            <name>Win</name>
            <outcome id="11401422" linkedId="11401422">
                <name>Selection 4</name>
                <status>A|S</status>                                             
                <displayStatus>A|I</displayStatus>                               
                <numLikes>0</numLikes>
                <livePrice>
                    <priceNum>15</priceNum>
                    <priceDen>4</priceDen>
                    <priceFrac>15/4</priceFrac>
                    <priceDec>4.75</priceDec>
                    <priceUS>375</priceUS>
                </livePrice>
                <startingPrice>Y</startingPrice>
            </outcome>
        </market>
    </event>
  </comment>
</whoCommunities>
application/json
{
  "whoCommunities": {
    "comment": {
      "id": "12345",
      "type": "tip",
      "betId": "6566",
      "status": "A|W|L",
      "createdDateTimeZoned": "2014-02-12T13:07:42Z",
      "text": "This is a winner for sure!",
      "isFeatured": "Y|N",
      "event": {
        "id": "115545",
        "name": "Louise Ascot 15:00",
        "sportId": "9",
        "market": {
          "id": "5527758",
          "name": "Win",
          "outcome": {
            "id": "11401422",
            "linkedId": "11401422",
            "name": "Selection 4",
            "status": "A|S",
            "displayStatus": "A|I",
            "numLikes": "0",
            "livePrice": {
              "priceNum": "15",
              "priceDen": "4",
              "priceFrac": "15/4",
              "priceDec": "4.75",
              "priceUS": "375"
            },
            "startingPrice": "Y"
          }
        }
      }
    }
  }
}
Status: 409 (Conflict) - Fault 30520 - Tip Already placed against outcome and bet
Representations
application/xml
<whoFaults>
  <fault>
     <faultCode>30520</faultCode>
     <faultString>Tip already created against bet</faultString>
     <faultName>betId</faultName>
  </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30520",
      "faultString": "Tip already created against bet",
      "faultName": "betId"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - Invalid Bet Id
Representations
application/xml
<whoFaults>
  <fault>
     <faultCode>10071</faultCode>
     <faultString>Invalid request parameter</faultString>
     <faultName>betId</faultName>
  </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request parameter",
      "faultName": "betId"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - Invalid Outcome Id
Representations
application/xml
<whoFaults>
    <fault>
       <faultCode>10071</faultCode>
       <faultString>Invalid request parameter</faultString>
       <faultName>outcomeId</faultName>
    </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request parameter",
      "faultName": "outcomeId"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - Invalid Linked Outcome Id
Representations
application/xml
 <whoFaults>
    <fault>
       <faultCode>10071</faultCode>
       <faultString>Invalid request parameter</faultString>
       <faultName>linkedOutcomeId</faultName>
    </fault>
 </whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request parameter",
      "faultName": "linkedOutcomeId"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - Tip text too long (300 chars Max)
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request paramter</faultString>
      <faultName>text</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request paramter",
      "faultName": "text"
    }
  }
}
Status: 400 (Bad Request) - Fault 30431 - Tip text allows only ancillary characters
Representations
application/xml
<whoFault>
   <fault>
      <faultCode>30431</faultCode>                       
      <faultString>Only allows ancillary characters</faultString>
      <faultName>text</faultName>
   </fault>
</whoFault>
application/json
{
  "whoFault": {
    "fault": {
      "faultCode": "30431",
      "faultString": "Only allows ancillary characters",
      "faultName": "text"
    }
  }
}
Status: 400 (Bad Request) - Fault 30432 - Tip text contains inappropriate content
Representations
application/xml
<whoFault>
   <fault>
      <faultCode>30432</faultCode>                        
      <faultString>Inappropriate content</faultString>
      <faultName>text</faultName>
      <solution>This is my ****** comment</solution>
   </fault>
</whoFault>
application/json
{
  "whoFault": {
    "fault": {
      "faultCode": "30432",
      "faultString": "Inappropriate content",
      "faultName": "text",
      "solution": "This is my ****** comment"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - Bet Id given is not yours
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request parameter</faultString>
      <faultName>betId</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request parameter",
      "faultName": "betId"
    }
  }
}
Status: 400 (Bad Request) - Fault 10070 - Missing Bet Id
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10070</faultCode>
      <faultString>Missing request parameter</faultString>
      <faultName>betId</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10070",
      "faultString": "Missing request parameter",
      "faultName": "betId"
    }
  }
}
Status: 400 (Bad Request) - Fault 10070 - Missing Outcome Id
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10070</faultCode>
      <faultString>Missing request parameter</faultString>
      <faultName>outcomeId</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10070",
      "faultString": "Missing request parameter",
      "faultName": "outcomeId"
    }
  }
}
Status: 400 (Bad Request) - Fault 10070 - Missing Tip text
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10070</faultCode>
      <faultString>Missing request parameter</faultString>
      <faultName>text</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10070",
      "faultString": "Missing request parameter",
      "faultName": "text"
    }
  }
}
Status: 400 (Bad Request) - Fault 30490 - Event / Market / Selection is not active so comment creation is no longer allowed.
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30490</faultCode>
      <faultString>Outcome not active</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30490",
      "faultString": "Outcome not active",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 30491 - Profile not active
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30491</faultCode>
      <faultString>Profile not active</faultString>
      <faultName></faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30491",
      "faultString": "Profile not active",
      "faultName": ""
    }
  }
}
Status: 400 (Bad Request) - Fault 30492 - Outcome's sport is not enabled for communities
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30492</faultCode>
      <faultString>Outcome's sport is not enabled for communities</faultString>
      <faultName>{outcomeId}</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30492",
      "faultString": "Outcome's sport is not enabled for communities",
      "faultName": "{outcomeId}"
    }
  }
}
getAllCommentbyProfileId()
Reads active or winning comments on a specific profile so that you can build functionality in your application to display tips.
Request Example
GET /v1/communities/comments/profiles/{id} HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
Request Parameters
template parameters
NameTypeDescription
idstring
(required)
The unique identified of the profile
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstringAnother unique identifier for your application. The secret must never be sent over HTTP.
query parameters
NameTypeDescription
sportIdstringThe id of the sport for which you want to get bets for
sortOrderstringL|E|R meaning L=Most Liked (numberOfLikes)| E=Event Time (orderBy=eventDateTime) | R=Most Recent (orderBy=createdAt) default R
statusstring
(required)
A|W meaining A- active and W- winning
blockSizestringThe number of comments per page(block) for bet history retrieval. The maximum number for the blockSize is 20.
blockNumstringThe number of items in your response. Value should be between 1 and 100, for example 10.
Response Description
whoCommunities
Object Name Type Constraints Optional Description
element comment - Exactly one child node No Node
comment
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The id of the comment
element type Integer type No The type of the comment
element bet id Integer [0-9]+ No The unique identifier of the bet
element status Character A|W|L No The status of the comment: Active, Winning, Losing
element createdDateTimeZoned DateTime ISO 8601 No The timestamp when the comment was created
element text String Characters allowed: A-Z, a-z, 0-9 max 900 characters No The text content of the comment
element isFeatured Character Y|N No Indicates if the comment is featured or not.
element isFlagged String Y|N Yes Indicates if this comment is flagged by the requester.
element isLiked String Y|N Yes Indicates if this comment is liked by the requester.
node event Node Exactly one child node No Event node
event
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the event
attribute sportId Integer [0-9]+ No The unique identifier of the sport
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the event
node market Node Exactly one child node No Market node
market
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the market
element name String Characters allowed: A-Z, a-z, 0-9 No Name of the market
element outcome - Exactly one child node No Node
outcome
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the outcome
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the outcome
element status Character A|S No The status of the event: Active or Suspended
element numLikes Integer [0-9]+ No The number of likes on the outcome
element displayStatus Character A|I No The displayStatus effectively shows whether the comment can be displayed or not based on the status of the event/market/selection it belongs to. If any of those are suspended or settled, then the displayStatus will change to INACTIVE.
element startingPrice Character Y Yes Indicates if the price type of the outcome is a starting price.
node livePrice Node Zero or one node Yes LivePrice node
livePrice
Object Name Type Constraints Optional Description
element priceNum Integer [0-9]+ Yes When the odds are shown in simple fractions this is the numerator of the fraction, for example 2 in 2/5.
element priceDen Integer [0-9]+ Yes When the odds are shown in simple fractions this is the denominator of the fraction, for example 5 in 2/5.
element priceFrac fractions [0-9]+/[1-9][0-9]+ Yes This field shows the odds in simple fractions.
element priceDec Double [0-9]+.[0-9]* Yes This field shows the odds in decimal.
element priceUS Integer [0-9]+ Yes This field shows the odds in format used in the USA.
ResponsesExpand AllCollapse All
Status: 200 (Ok) - Success - list of comments on a profile
Representations
application/xml
<whoCommunities>
    <comment id="12345" type="tip">
       <betId>6566</betId>
       <status>A|W|L</status>                                                       
       <createdDateTimeZoned>2014-02-12T13:07:42Z</createdDateTimeZoned>
       <text>This is a winner for sure!</text>
       <isFeatured>Y|N</isFeatured>
       <event id="115545" sportId="9">
          <name>Louise Ascot 15:00</name>
          <market id="5527758">
             <name>Win</name>
             <outcome id="11401422">
                <name>Selection 4</name>
                <status>A|S</status>                                            
                <numLikes>234</numLikes>
                <displayStatus>A|I</displayStatus>                               
                <startingPrice>Y</startingPrice>
                <livePrice>
                   <priceNum>15</priceNum>
                   <priceDen>4</priceDen>
                   <priceFrac>15/4</priceFrac>
                   <priceDec>4.75</priceDec>
                   <priceUS>375</priceUS>
                </livePrice>
             </outcome>
          </market>
       </event>
    </comment>
    <!-- comment .. -->
 </whoCommunities>
application/json
{  
  "whoCommunities": {
    "comment": {
      "id": "12345W",
      "type": "tip",
      "betId": "6566",
      "status": "A|W|L",
      "createdDateTimeZoned": "2014-02-12T13:07:42Z",
      "text": "This is a winner for sure!",
      "isFeatured": "Y|N",
      "event": {
        "id": "115545",
        "name": "Louise Ascot 15:00",
        "sportId": "9",
        "market": {
          "id": "5527758",
          "name": "Win",
          "outcome": {
            "id": "11401422",
            "name": "Selection 4",
            "status": "A|S",
            "numLikes": "234",
            "displayStatus": "A|I",
            "startingPrice": "Y",
            "livePrice": {
              "priceNum": "15",
              "priceDen": "4",
              "priceFrac": "15/4",
              "priceDec": "4.75",
              "priceUS": "375"
            }
          }
        }
      }
    }
  }
}
Status: 204 (No Content) - Success - No comment on specific profile
Status: 400 (Bad Request) - Fault 10070 - No {id} for profile
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10070</faultCode>
      <faultString>Missing request parameter</faultString>
      <faultName>profileId</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10070",
      "faultString": "Missing request parameter",
      "faultName": "profileId"
    }
  }
}
Status: 400 (Bad Request) - Fault 30410 - No profile found for {profileId}
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30410</faultCode>
      <faultString>No profile found for given id</faultString>
      <faultName>me</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30410",
      "faultString": "No profile found for given id",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - {id} in query is not a valid number
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request paramter</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request paramter",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - blockSize or blockNum does not meet parameter constraints
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request paramter</faultString>
      <faultName>blockSize|blockNum</faultName>               
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request paramter",
      "faultName": "blockSize|blockNum"
    }
  }
}
getAllMyComments()
Gets a list of all comments on my profile.
Request Example
GET /v1/communities/comments/profiles/me HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-ticket: tgtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request Parameters
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstring
(required)
Another unique identifier for your application. The secret must never be sent over HTTP.
who-ticketstring
(required)
The authentication ticket associated with the user session.
query parameters
NameTypeDescription
sportIdstring The unique identifier of the sport for which you want to get comments
sortOrderstringL|E|R meaning L=Most Liked (numberOfLikes)| E=Event Time (orderBy=eventDateTime) | R=Most Recent (orderBy=createdAt)
statusstring
(required)
A|W meaning A - active and W - winning
blockSizestringThe number of comments per page(block) for bet history retrieval. The maximum number for the blockSize is 20.
blockNumstringThe number of items in your response. Value should be between 1 and 100, for example 10.
Response Description
whoCommunities
Object Name Type Constraints Optional Description
element comment - Exactly one child node No Node
comment
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The id of the comment
element type Integer type No The type of the comment
element bet id Integer [0-9]+ No The unique identifier of the bet
element status Character A|W|L No The status of the comment: Active, Winning, Losing
element createdDateTimeZoned DateTime ISO 8601 No The timestamp when the comment was created
element text String Characters allowed: A-Z, a-z, 0-9 max 900 characters No The text content of the comment
element isFeatured Character Y|N No Indicates if the comment is featured or not.
element isFlagged String Y|N Yes Indicates if this comment is flagged by the requester.
element isLiked String Y|N Yes Indicates if this comment is liked by the requester.
node event Node Exactly one child node No Event node
event
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the event
attribute sportId Integer [0-9]+ No The unique identifier of the sport
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the event
node market Node Exactly one child node No Market node
market
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the market
element name String Characters allowed: A-Z, a-z, 0-9 No Name of the market
element outcome - Exactly one child node No Node
outcome
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the outcome
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the outcome
element status Character A|S No The status of the event: Active or Suspended
element numLikes Integer [0-9]+ No The number of likes on the outcome
element displayStatus Character A|I No The displayStatus effectively shows whether the comment can be displayed or not based on the status of the event/market/selection it belongs to. If any of those are suspended or settled, then the displayStatus will change to INACTIVE.
element startingPrice Character Y Yes Indicates if the price type of the outcome is a starting price.
node livePrice Node Zero or one node Yes LivePrice node
livePrice
Object Name Type Constraints Optional Description
element priceNum Integer [0-9]+ Yes When the odds are shown in simple fractions this is the numerator of the fraction, for example 2 in 2/5.
element priceDen Integer [0-9]+ Yes When the odds are shown in simple fractions this is the denominator of the fraction, for example 5 in 2/5.
element priceFrac fractions [0-9]+/[1-9][0-9]+ Yes This field shows the odds in simple fractions.
element priceDec Double [0-9]+.[0-9]* Yes This field shows the odds in decimal.
element priceUS Integer [0-9]+ Yes This field shows the odds in format used in the USA.
ResponsesExpand AllCollapse All
Status: 200 (Ok) - Success - List of comments on my profile
Representations
application/xml
<whoCommunities>
    <comment id="12345" type="tip">
       <betId>6566</betId>
       <status>A|W|L</status>                                                       
       <createdDateTimeZoned>2014-02-12T13:07:42Z</createdDateTimeZoned>
       <text>This is a winner for sure!</text>
       <isFeatured>Y|N</isFeatured>
       <event id="115545" sportId="9">
          <name>Louise Ascot 15:00</name>
          <market id="5527758">
             <name>Win</name>
             <outcome id="11401422">
                <name>Selection 4</name>
                <status>A|S</status>                                            
                <numLikes>234</numLikes>
                <displayStatus>A|I</displayStatus>                               
                <startingPrice>Y</startingPrice>
                <livePrice>
                   <priceNum>15</priceNum>
                   <priceDen>4</priceDen>
                   <priceFrac>15/4</priceFrac>
                   <priceDec>4.75</priceDec>
                   <priceUS>375</priceUS>
                </livePrice>
             </outcome>
          </market>
       </event>
    </comment>
    <!-- comment.. -->
 </whoCommunities>
application/json
{  
  "whoCommunities": {
    "comment": {
      "id": "12345W",
      "type": "tip",
      "betId": "6566",
      "status": "A|W|L",
      "createdDateTimeZoned": "2014-02-12T13:07:42Z",
      "text": "This is a winner for sure!",
      "isFeatured": "Y|N",
      "event": {
        "id": "115545",
        "name": "Louise Ascot 15:00",
        "sportId": "9",
        "market": {
          "id": "5527758",
          "name": "Win",
          "outcome": {
            "id": "11401422",
            "name": "Selection 4",
            "status": "A|S",
            "numLikes": "234",
            "displayStatus": "A|I",
            "startingPrice": "Y",
            "livePrice": {
              "priceNum": "15",
              "priceDen": "4",
              "priceFrac": "15/4",
              "priceDec": "4.75",
              "priceUS": "375"
            }
          }
        }
      }
    }
  }
}
Status: 204 (No Content) - Success - No comments on my profile
Status: 404 (Not Found) - Fault 30410 - No profile found for {profileId}
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30410</faultCode>
      <faultString>No profile found for given id</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30410",
      "faultString": "No profile found for given id",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - blockSize or blockNum does not meet parameter constraints
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request paramter</faultString>
      <faultName>blockSize|blockNum</faultName>               
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request paramter",
      "faultName": "blockSize|blockNum"
    }
  }
}
getTopOutcomes()
Reads a list of the top tipper outcomes (top tipped selections).
Request Example
GET /v1/communities/comments/outcomes/top HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
Request Parameters
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstring
(required)
Another unique identifier for your application. The secret must never be sent over HTTP.
Response Description
whoCommunities
Object Name Type Constraints Optional Description
element event - Exactly one child node No Node
event
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the event
attribute sportId Integer [0-9]+ No The unique identifier of the sport
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the event
node market Node Exactly one child node No Market node
market
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the market
element name String Characters allowed: A-Z, a-z, 0-9 No Name of the market
element outcome - Exactly one child node No Node
outcome
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the outcome
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the outcome
element status Character A|S No The status of the event: Active or Suspended
element numLikes Integer [0-9]+ No The number of likes on the outcome
element displayStatus Character A|I No The displayStatus effectively shows whether the comment can be displayed or not based on the status of the event/market/selection it belongs to. If any of those are suspended or settled, then the displayStatus will change to INACTIVE.
element startingPrice Character Y Yes Indicates if the price type of the outcome is a starting price.
node livePrice Node Zero or one node Yes LivePrice node
livePrice
Object Name Type Constraints Optional Description
element priceNum Integer [0-9]+ Yes When the odds are shown in simple fractions this is the numerator of the fraction, for example 2 in 2/5.
element priceDen Integer [0-9]+ Yes When the odds are shown in simple fractions this is the denominator of the fraction, for example 5 in 2/5.
element priceFrac fractions [0-9]+/[1-9][0-9]+ Yes This field shows the odds in simple fractions.
element priceDec Double [0-9]+.[0-9]* Yes This field shows the odds in decimal.
element priceUS Integer [0-9]+ Yes This field shows the odds in format used in the USA.
ResponsesExpand AllCollapse All
Status: 200 (Ok) - Success
Representations
application/xml
<whoCommunities>
    <event id="115545" sportId="9">
        <name>Louise Ascot 15:00</name>
        <market id="5527758">
            <name>Win</name>
            <outcome id="11401422" rank="1">
                <name>Selection 4</name>                       
                <comments type="tip">
                    <numLive>234</numLive>
                </comments>
                <status>A|S</status>
                <displayStatus>A|I</displayStatus>
                <startingPrice>N</startingPrice>
                <livePrice>
                    <priceNum>15</priceNum>
                    <priceDen>4</priceDen>
                    <priceFrac>15/4</priceFrac>
                    <priceDec>4.75</priceDec>
                    <priceUS>375</priceUS>
                </livePrice>
            </outcome>
        </market>
    </event>
</whoCommunities>
application/json
{
  "whoCommunities": {
    "event": {
      "id": "115545",
      "name": "Louise Ascot 15:00",
      "sportId": "9",
      "market": {
        "id": "5527758",
        "name": "Win",
        "outcome": {
          "id": "11401422",
          "rank": "1",
          "name": "Selection 4",
          "comments": {
            "type": "tip",
            "numLive": "234"
          },
          "status": "A|S",
          "displayStatus": "A|I",
          "startingPrice": "N",
          "livePrice": {
            "priceNum": "15",
            "priceDen": "4",
            "priceFrac": "15/4",
            "priceDec": "4.75",
            "priceUS": "375"
          }
        }
      }
    }
  }
}
getAllMyFollowingsComments()
Reads a list of all comments on my followings' profiles.
Request Example
GET /v1/communities/comments/profiles/me/followings HTTP/1.1
Host: sandbox.whapi.com
Accept: application/xml
who-apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-secret: l7xxa54460c573b5497c9b24b505xxxxxxxx
who-ticket: tgtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request Parameters
header parameters
NameTypeDescription
acceptstring
(required)
default:
application/xml
options:
application/xml, application/json
The representation of the response.
who-apiKeystring
(required)
A unique identifier of your application that is generated by the API portal and presented in the header.
who-secretstring
(required)
Another unique identifier for your application. The secret must never be sent over HTTP.
who-ticketstring
(required)
The authentication ticket associated with the user session.
query parameters
NameTypeDescription
sportIdstringThe unique identifier of the sport for which you want to get comments
sortOrderstringL|E|R meaning L=Most Liked (numberOfLikes)| E=Event Time (orderBy=eventDateTime) | R=Most Recent (orderBy=createdAt)
statusstring
(required)
A|W meaning A - active and W - winning
blockSizestring The number of comments per page(block) for bet history retrieval. The maximum number for the blockSize is 20.
blockNumstringThe number of items in your response. Value should be between 1 and 100, for example 10.
Response Description
whoCommunities
Object Name Type Constraints Optional Description
element comment - Exactly one child node No Node
comment
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The id of the comment
element type Integer type No The type of the comment
element bet id Integer [0-9]+ No The unique identifier of the bet
element status Character A|W|L No The status of the comment: Active, Winning, Losing
element createdDateTimeZoned DateTime ISO 8601 No The timestamp when the comment was created
element text String Characters allowed: A-Z, a-z, 0-9 max 900 characters No The text content of the comment
element isFeatured Character Y|N No Indicates if the comment is featured or not.
element isFlagged String Y|N Yes Indicates if this comment is flagged by the requester.
element isLiked String Y|N Yes Indicates if this comment is liked by the requester.
node event Node Exactly one child node No Event node
event
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the event
attribute sportId Integer [0-9]+ No The unique identifier of the sport
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the event
node market Node Exactly one child node No Market node
market
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the market
element name String Characters allowed: A-Z, a-z, 0-9 No Name of the market
element outcome - Exactly one child node No Node
outcome
Object Name Type Constraints Optional Description
attribute id Integer [0-9]+ No The unique identifier of the outcome
element name String Characters allowed: A-Z, a-z, 0-9 No The name of the outcome
element status Character A|S No The status of the event: Active or Suspended
element numLikes Integer [0-9]+ No The number of likes on the outcome
element displayStatus Character A|I No The displayStatus effectively shows whether the comment can be displayed or not based on the status of the event/market/selection it belongs to. If any of those are suspended or settled, then the displayStatus will change to INACTIVE.
element startingPrice Character Y Yes Indicates if the price type of the outcome is a starting price.
node livePrice Node Zero or one node Yes LivePrice node
livePrice
Object Name Type Constraints Optional Description
element priceNum Integer [0-9]+ Yes When the odds are shown in simple fractions this is the numerator of the fraction, for example 2 in 2/5.
element priceDen Integer [0-9]+ Yes When the odds are shown in simple fractions this is the denominator of the fraction, for example 5 in 2/5.
element priceFrac fractions [0-9]+/[1-9][0-9]+ Yes This field shows the odds in simple fractions.
element priceDec Double [0-9]+.[0-9]* Yes This field shows the odds in decimal.
element priceUS Integer [0-9]+ Yes This field shows the odds in format used in the USA.
ResponsesExpand AllCollapse All
Status: 200 (Ok) - Success - List of comments on my profile
Representations
application/xml
<whoCommunities>
    <comment id="12345" type="tip">
       <betId>6566</betId>
       <status>A|W|L</status>                                                       
       <createdDateTimeZoned>2014-02-12T13:07:42Z</createdDateTimeZoned>
       <text>This is a winner for sure!</text>
       <isFeatured>Y|N</isFeatured>
       <event id="115545" sportId="9">
          <name>Louise Ascot 15:00</name>
          <market id="5527758">
             <name>Win</name>
             <outcome id="11401422">
                <name>Selection 4</name>
                <status>A|S</status>                                            
                <numLikes>234</numLikes>
                <displayStatus>A|I</displayStatus>                               
                <startingPrice>Y</startingPrice>
                <livePrice>
                   <priceNum>15</priceNum>
                   <priceDen>4</priceDen>
                   <priceFrac>15/4</priceFrac>
                   <priceDec>4.75</priceDec>
                   <priceUS>375</priceUS>
                </livePrice>
             </outcome>
          </market>
       </event>
    </comment>
    <!-- comment.. -->
 </whoCommunities>
application/json
{  
  "whoCommunities": {
    "comment": {
      "id": "12345W",
      "type": "tip",
      "betId": "6566",
      "status": "A|W|L",
      "createdDateTimeZoned": "2014-02-12T13:07:42Z",
      "text": "This is a winner for sure!",
      "isFeatured": "Y|N",
      "event": {
        "id": "115545",
        "name": "Louise Ascot 15:00",
        "sportId": "9",
        "market": {
          "id": "5527758",
          "name": "Win",
          "outcome": {
            "id": "11401422",
            "name": "Selection 4",
            "status": "A|S",
            "numLikes": "234",
            "displayStatus": "A|I",
            "startingPrice": "Y",
            "livePrice": {
              "priceNum": "15",
              "priceDen": "4",
              "priceFrac": "15/4",
              "priceDec": "4.75",
              "priceUS": "375"
            }
          }
        }
      }
    }
  }
}
Status: 204 (No Content) - Success - No comments on my profile
Status: 404 (Not Found) - Fault 30410 - No profile found for {profileId}
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>30410</faultCode>
      <faultString>No profile found for given id</faultString>
      <faultName>id</faultName>
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "30410",
      "faultString": "No profile found for given id",
      "faultName": "id"
    }
  }
}
Status: 400 (Bad Request) - Fault 10071 - blockSize or blockNum does not meet parameter constraints
Representations
application/xml
<whoFaults>
   <fault>
      <faultCode>10071</faultCode>
      <faultString>Invalid request paramter</faultString>
      <faultName>blockSize|blockNum</faultName>               
   </fault>
</whoFaults>
application/json
{
  "whoFaults": {
    "fault": {
      "faultCode": "10071",
      "faultString": "Invalid request paramter",
      "faultName": "blockSize|blockNum"
    }
  }
}
Error Handling
General Error Structure
As an application developer, you will need to see a standard error response when the system generates an error. As well as supplying a standard HTTP status code, we also supply a unique William Hill fault code, fault string and fault name (in some cases) to help you identify and resolve any issues that you may be having with our API or your requests and code.

Where the elements can be defined as the following:
  • Fault code - A unique William Hill identifier for the error
  • Fault string - A unique William Hill text string to enable you to identify the error (in English only)
  • HTTP code - the standard HTTP status code for the error
  • HTTP response - the standard HTTP response for the error

Note: A Fault name may also be generated in order to pinpoint the exact parameter where a request has failed.

Available Response Formats

The error codes are supplied in the following representations:

  • XML
  • JSON
Error Response Body

The response body will contain the unique William Hill fault code and fault string appropriate to the corresponding error.

The response will be sent according to the representation type governed by the accept parameter within the original request. The default representation is for application/xml and this representation will be returned if either the accept header is absent or if the accept header is set to application/xml.

Generic William Hill Error Codes

Click here to view the complete list of William Hill error codes for the APIs.

API Specific Error Codes

Error codeFault stringHTTP codeHTTP response
30410 No profile found for id 404 Not Found
30431 Only ancillary characters 400 Bad Request
30432 Inappropriate content 400 Bad Request
30490 Outcome not active 400 Bad Request
30491 Profile not active 400 Bad Request
30492 Outcome's sport is not enabled for communities 400 Bad Request
30500 No comment found for id 400 Bad Request
30520 Tip already created against bet 409 Conflict
HTTP Status Codes

For more information about how William Hill uses HTTP status codes with their APIs, click here.