OMR Template error in sample code

Hi,
I am try to explore omr apis but getting error in MarkupFile but provided source codein base64 encode as sample code.
APi Response:
{
“requestId”: “0ae7835a-595b-42dd-9c97-8932b6ea60bb”,
“error”: {
“code”: “errorInvalidInputData”,
“message”: “model: The model field is required.\nImages: Unexpected token when deserializing object: StartObject. Path ‘Images’, line 3, position 12.\nMarkupFile: The supplied value is invalid for MarkupFile.”,
“description”: “Operation Failed. The input data is not valid.”,
“dateTime”: “2024-12-17T12:29:11.1536398Z”,
“innerError”: null
}
}

@PadamaRam

It seems that you are encountering an error related to the MarkupFile when using the OMR APIs. The error message indicates that the input data is not valid, specifically mentioning that the model field is required, and there is an issue with the Images and MarkupFile fields.

Here are a few steps you can take to troubleshoot and resolve this issue:

  1. Ensure Required Fields are Present: Make sure that you are including all required fields in your request. The error message suggests that the model field is missing. Verify that you are providing this field in your API call.

  2. Check the MarkupFile Format: The MarkupFile must be in a valid format. Ensure that the file you are sending is correctly formatted and encoded. If you are using Base64 encoding, double-check that the encoding is done properly.

  3. Validate Image Inputs: The error also mentions an issue with the Images field. Ensure that the images you are sending are correctly formatted and that there are no unexpected tokens in the JSON structure. Each image should be properly encoded and included in the request.

  4. Review Sample Code: You can refer to the sample code provided in the Aspose OMR SDK for guidance on how to structure your request. For example, in the C# sample, the OmrGenerateTask is created with the markupFile, settings, and images as parameters. Make sure your implementation follows a similar structure.

Here is a simplified example of how to create a request using the OMR API:

// Example of creating an OMRGenerateTask
string[] templateLogosImagesNames = new string[] { "logo1.jpg", "logo2.png" };
byte[] markupFile = File.ReadAllBytes("path_to_your_markup_file.txt");

Dictionary<string, byte[]> images = new Dictionary<string, byte[]>();
foreach (var imageName in templateLogosImagesNames)
{
    byte[] logo = File.ReadAllBytes($"path_to_your_images/{imageName}");
    images.Add(imageName, logo);
}

OmrGenerateTask task = new OmrGenerateTask(markupFile, new PageSettings(), images);
string templateId = instance.PostGenerateTemplate(task);

Make sure to replace "path_to_your_markup_file.txt" and "path_to_your_images/" with the actual paths to your files.

If you continue to face issues, consider checking the official documentation or the GitHub repository for more examples and detailed explanations of the API usage.

If you need further assistance, feel free to ask!

Sources:
[1]: GenerateTemplateApiTests.cs

there is no modal and images used in sample
Sample Input:
?text=Biology Quiz
font_size=16
font_style=bold
?empty_line=
?answer_sheet=Plants
columns_count=3
elements_count=15
answers_count=5
bubble_size=large
vertical_margin=10
answers_list=(α)(β)(γ)(δ)(ε)

and
Base6encoded: P3RleHQ9QmlvbG9neSBRdWl6DQoJZm9udF9zaXplPTE2DQoJZm9udF9zdHlsZT1ib2xkDQo/ZW1wdHlfbGluZT0NCj9hbnN3ZXJfc2hlZXQ9UGxhbnRzDQoJY29sdW1uc19jb3VudD0zDQoJZWxlbWVudHNfY291bnQ9MTUNCglhbnN3ZXJzX2NvdW50PTUNCglidWJibGVfc2l6ZT1sYXJnZQ0KCXZlcnRpY2FsX21hcmdpbj0xMA0KCWFuc3dlcnNfbGlzdD0ozrEpKM6yKSjOsykozrQpKM61KQ

Does anyone have a sample Postman collection for generating the OMR sheet and fetching the OMR?

Please share.