Creating a Scratch Card
Overview
Create a new Scratch Card.
URL
Parameters on the following URL are inside braces { }
{base_url}/rest/api/tools/createScratchCard/{instanceId}/{name}/{template}/{backgroundColor}/{link}/{publicKey}/{signature}
Please note that on the URL you won't see any POST parameters, only the regular parameters
All POST parameters will be highlighted in the following table.
Parameter Name | Description |
---|---|
instanceId | An instance id is the workspace identification number, if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login |
name | The name for this Scratch Card |
template | The desired template you want to use. Check out our templates gallery |
backgroundColor | The scratchcard's background color |
link | URL to redirect the user when the Scratch Card completes |
header POST | Header image. The file content type must be “multipart/form-data” |
footer POST | Footer image. The file content type must be “multipart/form-data” |
foreground POST | Foreground image. The file content type must be “multipart/form-data” |
backgroundtmp POST | Transition background image. The file content type must be “multipart/form-data” |
background POST | Background image. The file content type must be “multipart/form-data” |
footerHTML POST | Footer HTML. The file content type must be “multipart/form-data”. Write null to ignore this parameter |
publicKey | The public key to access this API. if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login |
signature | The unique SHA256 signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our Java Example |
Response
The Response XML is divided in a static part and a dynamic one, we call it dynamic because it will vary depending on the method you invoke. Please read our Response XML Basics section if you want to learn more about the response parts.
<input>createScratchCard</input> <status>OK</status> <description>Completed</description> <result> <ScratchCard> <id>ec0d1db1-40b7-462b-a43e-5e38116d87a4</id> <name>Test</name> <url>https://api.messangi.com/messangi-staging/content/scratchcards/cards/ec0d1db1-40b7-462b-a43e-5e38116d87a4</url> <success>true</success> <background>#d01010</background> <priceLink>https://messangi.com</priceLink> <footerhtml>Click <a href="messangi.com/terms">here for the Terms and Conditions</a></footerhtml> </ScratchCard> </result>
Please be aware that the <ScratchCard> tag and its content is a generic object and may apply to other responses in other methods.
Result parameters
Parameter Name | Description | Possible Values |
---|---|---|
ScratchCard.id | Scratch Card id | Text |
ScratchCard.name | Scratch Card name | Text |
ScratchCard.url | The public URL from which the scratchcard can be accessed. | URL |
ScratchCard.success | Indicates if the Scratch card was created | true false |
ScratchCard.background | The background color | Hex color code |
ScratchCard.priceLink | The URL where the background image will redirect the user | URL |
ScratchCard.footerhtml | The optional footer in format html or plain text. | HTML |
Edit a Scratch Card
Overview
Edit a Scratch Card.
URL
Parameters on the following URL are inside braces { }
{base_url}/rest/api/tools/editScratchCard/{instanceId}/{id}/{name}/{template}/{backgroundColor}/{link}/{publicKey}/{signature}
Please note that on the URL you won't see any POST parameters, only the regular parameters
All POST parameters will be highlighted in the following table.
Parameter Name | Description |
---|---|
instanceId | An instance id is the workspace identification number, if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login |
id | The Scratch Card's Id to edit |
name | The name for this Scratch Card |
template | The desired template you want to use. Check out our templates gallery |
backgroundColor | The scratchcard's background color |
link | URL to redirect the user when the Scratch Card completes |
header POST | Header image. The file content type must be “multipart/form-data” |
footer POST | Footer image. The file content type must be “multipart/form-data” |
foreground POST | Foreground image. The file content type must be “multipart/form-data” |
backgroundtmp POST | Transition background image. The file content type must be “multipart/form-data” |
background POST | Background image. The file content type must be “multipart/form-data” |
footerHTML POST | Footer HTML. The file content type must be “multipart/form-data”. Write null to ignore this parameter |
publicKey | The public key to access this API. if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login |
signature | The unique SHA256 signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our Java Example |
Response
The Response XML is divided in a static part and a dynamic one, we call it dynamic because it will vary depending on the method you invoke. Please read our Response XML Basics section if you want to learn more about the response parts.
<input>editScratchCard</input> <status>OK</status> <description>Completed</description> <result> <ScratchCard> <id>ec0d1db1-40b7-462b-a43e-5e38116d87a4</id> <name>Test</name> <url>https://api.messangi.com/messangi-staging/content/scratchcards/cards/ec0d1db1-40b7-462b-a43e-5e38116d87a4</url> <success>true</success> <background>#d01010</background> <priceLink>https://messangi.com</priceLink> <footerhtml>Click <a href="messangi.com/terms">here for the Terms and Conditions</a></footerhtml> </ScratchCard> </result>
Please be aware that the <ScratchCard> tag and its content is a generic object and may apply to other responses in other methods.
Result parameters
Parameter Name | Description | Possible Values |
---|---|---|
ScratchCard.id | Scratch Card id | Text |
ScratchCard.name | Scratch Card name | Text |
ScratchCard.url | The public URL from which the scratchcard can be accessed. | URL |
ScratchCard.success | Returns “true” once the scratchcard has been successfully edited in the system and “false” otherwise. | true false |
ScratchCard.background | The background color | Hex color code |
ScratchCard.priceLink | The URL where the background image will redirect the user | URL |
ScratchCard.footerhtml | The optional footer in format html or plain text. | HTML |
Retrieve a Scratch Card by Id
Overview
Retrieve a Scratch Card configuration given its id
URL
Parameters on the following URL are inside braces { }
{base_url}/rest/api/tools/getScratchCard/{instanceId}/{id}/{publicKey}/{signature}
Please note that on the URL you won't see any POST parameters, only the regular parameters
All POST parameters will be highlighted in the following table.
Parameter Name | Description |
---|---|
instanceId | An instance id is the workspace identification number, if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login |
id | The Scratch Card's Id to edit |
publicKey | The public key to access this API. if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login |
signature | The unique SHA256 signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our Java Example |
Response
The Response XML is divided in a static part and a dynamic one, we call it dynamic because it will vary depending on the method you invoke. Please read our Response XML Basics section if you want to learn more about the response parts.
<input>getScratchCard</input> <status>OK</status> <description>Completed</description> <result> <ScratchCard> <id>ec0d1db1-40b7-462b-a43e-5e38116d87a4</id> <name>Test</name> <url>https://api.messangi.com/messangi-staging/content/scratchcards/cards/ec0d1db1-40b7-462b-a43e-5e38116d87a4</url> <success>true</success> <foreimage>/9j/4S3bRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUAAAABAAAAYgEbAAU</foreimage> <background>#d01010</background> <priceLink>https://messangi.com</priceLink> <footerhtml>Click <a href="messangi.com/terms">here for the Terms and Conditions</a></footerhtml> </ScratchCard> </result>
Please be aware that the <ScratchCard> tag and its content is a generic object and may apply to other responses in other methods.
Result parameters
Parameter Name | Description | Possible Values |
---|---|---|
ScratchCard.id | Scratch Card id | Text |
ScratchCard.name | Scratch Card name | Text |
ScratchCard.url | The public URL from which the scratchcard can be accessed. | URL |
ScratchCard.success | Returns “true” once the scratchcard has been successfully created in the system and “false” otherwise. | true false |
ScratchCard.background | The background color | Hex color code |
ScratchCard.priceLink | The URL where the background image will redirect the user | URL |
ScratchCard.footerhtml | The optional footer in format html or plain text. | HTML |
Delete a Scratch Card by Id
Overview
Retrieve a Scratch Card configuration given its id
URL
Parameters on the following URL are inside braces { }
{base_url}/rest/api/tools/deleteScratchCard/{instanceId}/{id}/{publicKey}/{signature}
Please note that on the URL you won't see any POST parameters, only the regular parameters
All POST parameters will be highlighted in the following table.
Parameter Name | Description |
---|---|
instanceId | An instance id is the workspace identification number, if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login |
id | The Scratch Card's Id to delete |
publicKey | The public key to access this API. if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login |
signature | The unique SHA256 signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our Java Example |
Response
The Response XML is divided in a static part and a dynamic one, we call it dynamic because it will vary depending on the method you invoke. Please read our Response XML Basics section if you want to learn more about the response parts.
<input>deleteScratchCard</input> <status>OK</status> <description>Completed</description> <result> <transactionResult> <successful>true</successful> <message>Successful operation</message> </transactionResult> </result>
Please be aware that the <ScratchCard> tag and its content is a generic object and may apply to other responses in other methods.
Result parameters
Parameter Name | Description | Possible Values |
---|---|---|
successful | Indicates if the deletion was successful | true false |
message | A human readable explanation | Text |
Retrieving Scratch Cards
Overview
List client's Scratch Cards given a search criteria.
URL
Parameters on the following URL are inside braces { }
{base_url}/rest/api/tools/getScratchCardList/{instanceId}/{parameters}/{page}/{resultsPerPage}/{publicKey}/{signature}
Parameter Name | Description |
---|---|
instanceId | An instance id is the workspace identification number, if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login |
parameters | A search query string. Please read more in our Scratch Card Search String appendix |
page | This is a paginated method, so please use page to indicate the actual page you want to retrieve. |
resultsPerPage | How many results to show per page. Note that this will affect the total amount of pages |
publicKey | The public key to access this API. if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login |
signature | The unique SHA256 signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our Java Example |
Response
The Response XML is divided in a static part and a dynamic one, we call it dynamic because it will vary depending on the method you invoke. Please read our Response XML Basics section if you want to learn more about the response parts.
<input>getScratchCardList</input> <status>OK</status> <description>Completed</description> <result> <scratchCardsList> <records>2</records> <scratchCards> <ScratchCard> <id>ec0d1db1-40b7-462b-a43e-5e38116d87a4</id> <name>Test</name> <url>https://api.messangi.com/messangi-staging/content/scratchcards/cards/ec0d1db1-40b7-462b-a43e-5e38116d87a4</url> <success>true</success> <background>#d01010</background> <priceLink>https://messangi.com</priceLink> <footerhtml>Click <a href="messangi.com/terms">here for the Terms and Conditions</a></footerhtml> </ScratchCard> <ScratchCard> <id>c3415e59-e1c6-471b-a568-9ebeecca1e75</id> <name>Test2</name> <url>https://api.messangi.com/messangi-staging/content/scratchcards/cards/c3415e59-e1c6-471b-a568-9ebeecca1e75</url> <success>true</success> <background>#d01010</background> <priceLink>https://messangi.com</priceLink> <footerhtml>Click <a href="messangi.com/terms">here for the Terms and Conditions</a></footerhtml> </ScratchCard> </scratchCards> </scratchCardsList> </result>
Please be aware that the <ScratchCard> tag and its content is a generic object and may apply to other responses in other methods.
Result parameters
Parameter Name | Description | Possible Values |
---|---|---|
scratchCardsList.records | How many result on list | Number |
ScratchCard.id | Scratch Card id | Text |
ScratchCard.name | Scratch Card name | Text |
ScratchCard.url | The public URL from which the scratchcard can be accessed. | URL |
ScratchCard.success | Returns “true” once the scratchcard has been successfully created in the system and “false” otherwise. | true false |
ScratchCard.background | The background color | Hex color code |
ScratchCard.priceLink | The URL where the background image will redirect the user | URL |
ScratchCard.footerhtml | The optional footer in format html or plain text. | HTML |