Get Email Template Information
Introduction
The queryEmailTemplates endpoint facilitates the retrieval of email templates for a client program.
| Method | API Service | Endpoint | Type |
|---|---|---|---|
| GET | rewardsOrderProcessing | queryEmailTemplates → Explore | Synchronous |
URI: https://api.certification.blackhawknetwork.com/rewardsOrderProcessing/v1/queryEmailTemplates?clientprogramNumber=<Client Program Number>
Retrieving Email Templates
Request Header
To send the request for email templates we need to send the following information in the request header:
| Parameter | Description | Type | Required | Default Value |
|---|---|---|---|---|
| merchantID | A string identifier issued by BHN to each contractual legal entity for billing purposes | String | Yes | None |
| requestID | A globally unique string identifier specified by the application making the request to be used during reconciliation and to facilitate idempotence. | String | Yes | None |
In our example we will be sending the following values:
Content-Type: application/json
merchantId: 20200009887
requestId: 2019-10-31T15:25:11-0600Query Parameters
The following query parameters need to be sent:
| Parameter | Description | Type | Required |
|---|---|---|---|
| clientProgramNumber | clientProgramNumber | String | Yes |
Responses
Assuming the query was successful a JSON object will be returned in the response containing the following information:
| Parameter | Description | Type | Required |
|---|---|---|---|
| current | The endpoint that was called. | String | Yes |
| totalCount | The count of email templates returned for the client program | Integer | Yes |
| currentResults | The returned email template details | Object | No |
CurrentResults Object
| Parameter | Description | Required | Type | Allowed Values |
|---|---|---|---|---|
| message | Results | No | String | |
| emailTemplateId | Template Identifier | No | String | |
| clientProgramNumber | Client Program | No | String | |
| isDefault | No | String | true/false | |
| emailTemplateName | Configured Name of the template | No | String |
{
"current": "https://api.certification.blackhawknetwork.com/rewardsOrderProcessing/v1/queryEmailTemplates",
"totalCount": 1,
"currentResults": [ {
"emailTemplateId": 2872,
"clientProgramNumber": 95004996,
"isDefault": true,
"emailTemplateName": "CUSTOM_TEMPLATE"
}]
}Error Code Reference
Listed below are common error codes you may receive when calling this API.
| HTTP Status Code | Error Code | Message | Explanation of Error | Resolution |
|---|---|---|---|---|
| 200 | ||||
| 202 | ||||
| 400 | search.criteria.clientProgramNumber.required | Client Program number is required. | You did not send an client program number. | Ensure a client program number is passed in the request. |
Sample Error Response
HTTP/1.1 404
Date: Fri, 17 Nov 2023 21:24:54 GMT
Server: Apache
Content-Type: application/json
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
BHN-TRACE-ID: ZVfaJdmf@XbN1tdc@RMrEAAAAIM
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
{
"errors" : [ {
"errorCode" : "client.program.not.found",
"message" : "client program number not found."
} ]
}Updated 8 days ago
