Comments for Multiple Locations
Endpoint
POSThttps://api1.consumerism.pressganey.com/api/bsr/comments
Header Parameters
| Property | Type | Description | Required/Optional |
|---|---|---|---|
| Content-Type | application/x-www-form-urlencoded | URL Encoded request body | Required |
| Access-Token | String | Access token received from the platform | Required |
POST Request Parameters
Required Fields
| Property | Type | Description | Required/Optional |
|---|---|---|---|
| locationId | String | Unique identifier of a Location. You can get this unique codes from the Mapping file. You can pass multiple location ID as &locationID=123&locationId=234 | Required |
Optional Request Parameters
Following parameters are optional fields you can pass to customize the results. You don't have to pass any of these, and we will use the default/industry standard values here.
| Property | Type | Description | Default Value |
|---|---|---|---|
| page | Integer | The page to return containing the requested number of testimonials per page | 1 |
| perPage | Integer | The number of reviews per page | 20 |
| days | Integer | Maximum age of the reviews in days. For example, days=7 means reviews from the past 1 week | 365 |
| fromDate | String | Start timestamp (use fromDate and toDate together and it has precedence over days). Format - ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss'Z') | |
| toDate | String | End Timestamp (use fromDate and toDate together and it has precedence over days). Format - ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss'Z') | |
| minSurveyCount | Integer | Returns responses only when there are at least as many ratings as specified in minRatingCount. | 0 |
| minRatingCount | Integer | Returns responses only when there are at least as many ratings as specified in minRatingCount. | 30 |
| minWordCount | Integer | Returns only those reviews, which have minimum number of words in it. | 0- meaning, no restriction on word count |
| showRatings | Boolean | If you don't need rating, send this parameter as false | true |
| showComments | Default | If you don't need comments, send this parameter as false | true |
| additionalFields | List<String> | List of string which specifies the additional fields needed in the API response. See Additional fields. |
Additional fields
Following are the additional fields we support. Pass one or more of them in additionalFields (for example, ["reviewSummary", "firstName"]) and the corresponding fields will be returned in the response.
| Property | Type | Description | Required/Optional |
|---|---|---|---|
| reviewSummary | String | API will return an AI generated summary of comments for a provider or location. These summaries reference the last 90 days of published comments. The minimum comment limit is 5. See Review summary format. | Optional |
| firstName | String | API will return the respondent's first name on each comment, when the survey collected it and the response is approved. Omitted from the comment when no name is available. | Optional |
| lastInitial | String | API will return the uppercase first letter of the respondent's last name on each comment, when the survey collected it and the response is approved. Omitted from the comment when no name is available. | Optional |
| Survey_language | String | API will return the language the respondent took the survey in (for example, EN) on each comment, from the survey's Language question, when the response is approved. Omitted from the comment when no language is available. | Optional |
Review summary format
To receive the AI summary, include "reviewSummary" in the additionalFields array of the request:
"additionalFields": ["reviewSummary"]
The summary is returned as a single string in entities[].reviewSummary. It contains exactly three paragraphs separated by a blank line (\n\n), and no headings or labels:
| Paragraph | Index (0-based) | Content |
|---|---|---|
| 1 | 0 | Key positive points and strengths patients mentioned, focused on the most commonly praised aspects. |
| 2 | 1 | Main opportunities for improvement raised in the reviews. |
| 3 | 2 | Overall summary of the patient experience and a high-level takeaway of how patients feel about their care. |
The API always returns the full three-paragraph text. To use an individual paragraph, split the string on \n\n:
- JavaScript
- Python
- Java
const parts = entity.reviewSummary ? entity.reviewSummary.split('\n\n') : [];
const [positives, improvements, overall] = parts;
parts = entity["reviewSummary"].split("\n\n") if entity.get("reviewSummary") else []
positives, improvements, overall = (parts + [None] * 3)[:3]
String summary = entity.getReviewSummary();
String[] parts = (summary == null || summary.isEmpty()) ? new String[0] : summary.split("\n\n");
String positives = parts.length > 0 ? parts[0] : null;
String improvements = parts.length > 1 ? parts[1] : null;
String overall = parts.length > 2 ? parts[2] : null;
- If
reviewSummaryis not requested, the field isnull. - If it is requested but no summary is available for the entity (for example, too few recent comments), the field is an empty string (
""). Check for this before splitting. - Paragraph order is stable, but guard against fewer than three paragraphs (for example,
parts.length >= 3) rather than assuming they are all present.
JSON Response
A JSON object containing the latest comments for the requested locations. Each JSON object within entities JSONArray represents a single location.
{
"status":{
"message":"success",
"code":200
},
"data":{
"entities":[
{
"id":"2_123_1",
"name":"Demo Location 1",
"reviewSummary":"The reviews highlighted several positive points about the healthcare provider. Patients felt the doctor was professional, caring, a good listener, and took time to understand their concerns. Multiple patients were very happy with their treatment and grateful for the care they received. However, one patient had an unsatisfactory experience feeling the doctor seemed annoyed, rushed, and uncaring about their condition. This highlights an opportunity for the provider to improve patient interactions by showing more empathy, fully listening to patient concerns, and taking whatever time is needed, regardless of schedule constraints. Additionally, the cost of prescriptions should be considered to provide affordable treatment options. Overall most patients reported very positive experiences feeling heard, understood, and effectively treated. But the one negative review shows room for improving patient interactions and affordability of care. Addressing those factors could help create consistently positive experiences for all patients.",
"totalCommentCount":3,
"totalRatingCount":6,
"totalSurveyCount":6,
"overallRating":{
"name":"Overall Satisfaction",
"value":3.6,
"questionRatings":[
{
"name":"CP instructions for follow-up care",
"value":3.5,
"responseCount":6
},
{
"name":"CP spoke using clear language",
"value":3.3,
"responseCount":6
},
{
"name":"Time CP spent with patient",
"value":3.5,
"responseCount":6
}
]
},
"comments":[
{
"id":6931217,
"source":"Demo survey-PG",
"mentionTime":"2017-01-09T07:12:55Z",
"wordCount":2,
"comment":"Good caring",
"overAllRating":{
"name":"Overall Satisfaction",
"value":4.75
},
"response": {
"responseText": "Sample Annotation Text",
"client": "BF Healthcare",
"respondedBy": "Test User",
"respondedTime": "2017-04-18T14:08:00Z"
}
"ratings":[
{
"name":"Access",
"value":4.38
},
{
"name":"Personal Issues",
"value":4.58
}
]
}
],
"totalPages":1,
"ratings":[
{
"name":"Access",
"value":2.8,
"questionRatings":[
{
"name":"Ease of getting clinic on phone",
"value":2.9,
"responseCount":6
}
]
},
{
"name":"Personal Issues",
"value":4,
"questionRatings":[
{
"name":"Convenience of our office hours",
"value":4.6,
"responseCount":6
}
]
},
{
"name":"Nurse/Assistant",
"value":4.2,
"questionRatings":[
{
"name":"Friendliness/courtesy of nurse/asst",
"value":3.8,
"responseCount":6
}
]
},
{
"name":"Overall Assessment",
"value":4.4,
"questionRatings":[
{
"name":"Staff worked together",
"value":4.7,
"responseCount":4
}
]
},
{
"name":"Moving through visit",
"value":4.1,
"questionRatings":[
{
"name":"Courtesy of registration staff",
"value":4.5,
"responseCount":5
}
]
}
]
},
{
"id":"_2_1212_12",
"name":"Demo Location 2",
"totalCommentCount":3,
"totalRatingCount":6,
"totalSurveyCount":6,
"overallRating":{
"name":"Overall Satisfaction",
"value":3.6,
"questionRatings":[
{
"name":"CP instructions for follow-up care",
"value":3.5,
"responseCount":6
},
{
"name":"CP spoke using clear language",
"value":3.3,
"responseCount":6
},
{
"name":"Time CP spent with patient",
"value":3.5,
"responseCount":6
}
]
},
"comments":[
{
"id":6931217,
"source":"Demo survey-PG",
"mentionTime":"2017-01-09T07:12:55Z",
"wordCount":2,
"comment":"Good caring",
"overAllRating":{
"name":"Overall Satisfaction",
"value":4.75
},
"ratings":[
{
"name":"Access",
"value":4.38
},
{
"name":"Personal Issues",
"value":4.58
}
]
}
],
"totalPages":1,
"ratings":[
{
"name":"Access",
"value":2.8,
"questionRatings":[
{
"name":"Ease of getting clinic on phone",
"value":2.9,
"responseCount":6
}
]
},
{
"name":"Personal Issues",
"value":4,
"questionRatings":[
{
"name":"Convenience of our office hours",
"value":4.6,
"responseCount":6
}
]
},
{
"name":"Nurse/Assistant",
"value":4.2,
"questionRatings":[
{
"name":"Friendliness/courtesy of nurse/asst",
"value":3.8,
"responseCount":6
}
]
},
{
"name":"Overall Assessment",
"value":4.4,
"questionRatings":[
{
"name":"Staff worked together",
"value":4.7,
"responseCount":4
}
]
},
{
"name":"Moving through visit",
"value":4.1,
"questionRatings":[
{
"name":"Courtesy of registration staff",
"value":4.5,
"responseCount":5
}
]
}
]
}
],
"filter":{
"minThreshold":0,
"minRatingCount":30,
"minSurveyCount":0,
"minWordCount":0,
"days":20,
"page":1,
"perPage":20,
"showComments":true,
"showRatings":true,
"configVersion":"v2",
"period":{
"to":"2017-01-10T07:52:08Z",
"from":"2016-12-21T00:00:00Z"
}
}
}
}
}
JSON Response Parameters
| Property | Type | Description |
|---|---|---|
| data.filter | Object | The filters applied on the testimonials |
| data.client | String | Organization Name in our dashboard |
| data.entities | Array | The physician entities for which data is being returned |
| data.entities.id | String | Unique identifier of the entity |
| data.entities.name | String | The name of the entity |
| data.entities.reviewSummary | String | Full AI summary: three paragraphs separated by \n\n. See Review summary format. |
| data.entities.totalRatingCount | Integer | Total number of survey responses available for primary rating. |
| data.entities.totalCommentCount | Integer | Number of actual comments available for the entity |
| data.entities.totalSurveyCount | Integer | Total number of surveys available for the entity |
| data.entities.overallRating.name | String | Overall Rating name |
| data.entities.overallRating.value | Decimal | Overall rating of the Provider |
| data.entities.overallRating.questionRatings | Array | Individual question level rating which contributed for the overall rating |
| data.entities.overallRating.questionRatings.name | String | Question name contributed for overall rating |
| data.entities.overallRating.questionRatings.value | Decimal | Star rating of the question |
| data.entities.overallRating.questionRatings.responseCount | Integer | No. of responses received for this question |
| data.entities.ratings | Array | The ratings for this entity |
| data.entities.ratings.name | String | The name of the rating |
| data.entities.ratings.value | Decimal | The score |
| data.entities.ratings.questionRatings | Array | List of questions used for calculating this rating |
| data.entities.ratings.questionRatings.name | String | Question text |
| data.entities.ratings.questionRatings.value | Decimal | Question rating |
| data.entities.ratings.questionRatings.responseCount | Integer | Total number of responses for this question |
| data.entities.comments | Array | The comments for this entity |
| data.entities.comments.id | Integer | Unique identifier of the Comment |
| data.entities.comments.comment | String | The comment content |
| data.entities.comments.firstName | String | Respondent's first name. Present only when requested in additionalFields and a name is available |
| data.entities.comments.lastInitial | String | First letter of the respondent's last name. Present only when requested in additionalFields and a name is available |
| data.entities.comments.Survey_language | String | Language the respondent took the survey in (for example, EN). Present only when requested in additionalFields and a language is available |
| data.entities.comments.overallRating | Object | Overall rating of the comment |
| data.entities.comments.overallRating.name | String | Overall rating name |
| data.entities.comments.overallRating.value | Decimal | Overall rating of the comment |
| data.entities.comments.ratings | Array | Individual ratings |
| data.entities.comments.ratings.name | String | The name of the rating |
| data.entities.comments.ratings.value | Decimal | Individual question rating |
| data.entities.comments.mentionTime | Datetime (ISO-8601) | The date & time at which this review was mentioned |