//[[restapi:start|RESTful API]]// ====== 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 [[misc:otto|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 [[restapi:appx_sc_templates|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 [[misc:otto|ticketing tool]], you will need to provide your Mobile Engagement Campaign Manager's URL and your user login// | | signature | The unique [[restapi:appx_ciphering#SHA256 - Cipher|SHA256]] signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our [[restapi:appx_call_ex|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 [[restapi:appx_resp_xml|Response XML Basics]] section if you want to learn more about the response parts. createScratchCard OK Completed ec0d1db1-40b7-462b-a43e-5e38116d87a4 Test https://api.messangi.com/messangi-staging/content/scratchcards/cards/ec0d1db1-40b7-462b-a43e-5e38116d87a4 true #d01010 https://messangi.com Click here for the Terms and Conditions Please be aware that the **////** 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 [[misc:otto|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 [[restapi:appx_sc_templates|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 [[misc:otto|ticketing tool]], you will need to provide your Mobile Engagement Campaign Manager's URL and your user login// | | signature | The unique [[restapi:appx_ciphering#SHA256 - Cipher|SHA256]] signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our [[restapi:appx_call_ex|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 [[restapi:appx_resp_xml|Response XML Basics]] section if you want to learn more about the response parts. editScratchCard OK Completed ec0d1db1-40b7-462b-a43e-5e38116d87a4 Test https://api.messangi.com/messangi-staging/content/scratchcards/cards/ec0d1db1-40b7-462b-a43e-5e38116d87a4 true #d01010 https://messangi.com Click here for the Terms and Conditions Please be aware that the **////** 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 [[misc:otto|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 [[misc:otto|ticketing tool]], you will need to provide your Mobile Engagement Campaign Manager's URL and your user login// | | signature | The unique [[restapi:appx_ciphering#SHA256 - Cipher|SHA256]] signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our [[restapi:appx_call_ex|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 [[restapi:appx_resp_xml|Response XML Basics]] section if you want to learn more about the response parts. getScratchCard OK Completed ec0d1db1-40b7-462b-a43e-5e38116d87a4 Test https://api.messangi.com/messangi-staging/content/scratchcards/cards/ec0d1db1-40b7-462b-a43e-5e38116d87a4 true /9j/4S3bRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUAAAABAAAAYgEbAAU #d01010 https://messangi.com Click here for the Terms and Conditions Please be aware that the **////** 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 [[misc:otto|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 [[misc:otto|ticketing tool]], you will need to provide your Mobile Engagement Campaign Manager's URL and your user login// | | signature | The unique [[restapi:appx_ciphering#SHA256 - Cipher|SHA256]] signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our [[restapi:appx_call_ex|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 [[restapi:appx_resp_xml|Response XML Basics]] section if you want to learn more about the response parts. deleteScratchCard OK Completed true Successful operation Please be aware that the **////** 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 [[misc:otto|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 [[restapi:appx_sc_search|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 [[misc:otto|ticketing tool]], you will need to provide your Mobile Engagement Campaign Manager's URL and your user login// | | signature | The unique [[restapi:appx_ciphering#SHA256 - Cipher|SHA256]] signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our [[restapi:appx_call_ex|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 [[restapi:appx_resp_xml|Response XML Basics]] section if you want to learn more about the response parts. getScratchCardList OK Completed 2 ec0d1db1-40b7-462b-a43e-5e38116d87a4 Test https://api.messangi.com/messangi-staging/content/scratchcards/cards/ec0d1db1-40b7-462b-a43e-5e38116d87a4 true #d01010 https://messangi.com Click here for the Terms and Conditions c3415e59-e1c6-471b-a568-9ebeecca1e75 Test2 https://api.messangi.com/messangi-staging/content/scratchcards/cards/c3415e59-e1c6-471b-a568-9ebeecca1e75 true #d01010 https://messangi.com Click here for the Terms and Conditions Please be aware that the **////** 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 |