Free Support Forum - aspose.cloud

Cloud API and Dart Integration

Hello,

I am trying to integrate your Cloud OMR functionality into a mobile app written in Dart. However, I’m very new to working with APIs, so I have a couple questions about the API functionality.

  1. I was experimenting with the Cloud API Reference and couldn’t get it to correct the template in my storage. I have a .png file used for the template and I have a .omr file that I made with the Windows client, but I kept getting an error that the template was not found. I believe there was an issue with the function params I was using, so could you please provide an example of
    a “JSON string containing packed template data,” since I’m not sure what “packed template data” refers to in this case.

  2. Is there a way to pass function params without an SDK, using only http request methods? Since there’s understandably no Dart SDK, would my best bet be to call something like Python and use that SDK instead?

  3. Is there a way to grade multiple images and combine them into one output? Say there are 3 pages of bubbles for the template and 3 pages of bubbles as responses. Is there a way for me to grade all 3 as one attempt and export the results once?

  4. I’ve reached the 50 credit for my app due to errors I received with the Cloud API. Is there a way you can reset that while I continue to test? Or can I make a new app with a fresh batch of 50 credits?

Thanks very much in advance for any help you can provide.

@zrosensohn

Thanks for your interest in Aspose.OMR Cloud. We are looking into your requirements and will update you soon.

For this request, I have logged a request in purchase forum as following. We will guide you shortly.
https://forum.aspose.cloud/t/request-reset-free-pricing-plan-credits/3627

Parameters in runOmrTask function consists of two values - FunctionParam and AdditionalParam. However, you only need FunctionParam, so you can forget about the second one. For CorrectTemplate action you need to pass omr file in specific form, it is JSON with the following structure:

Files[ {
string Name;
long Size;
string Data;
} ]
where Data is base64 string containing file data. Here’s an example of working param query, just replace name, size and data strings with yours

{
“FunctionParam”: “{\r\n “Files”: [\r\n {\r\n “Name”: “test.omr”,\r\n “Size”: 13709,\r\n “Data”: “ewogICAAogICAg…gIC9CiAgICBdCn0=”\r\n }\r\n ]\r\n}”,
“AdditionalParam”: null
}

It is exactly the same structure as in ResponseFiles returned as response of every omr request, so you can refer to it for reference. Also, in every SDK for every supported platform we have Demo projects that also contain code examples of how to pack template from file to this request.
Lets take Python for example:

Regarding general SDK use, we’d like to mention that correct and finalize functions should be called only once per template, and then recognition can be called rather easily without SDK, since only image and template id string should be passed.
Depending on your goal you can either use SDK for first two functions (Correct and Finalize) and then call recognition without SDK. Or you can use SDK for all tasks, which you may find rather convenient.

It may be possible to post-process results and join them into single file, and then call the grade function. I’m not entirely sure, though, so it should be tested. It may not work due to repeating questions (i.e. several records with same QuestionName), so either error may appear or they can be overwritten. It wasn’t designed to handle several pages really. But this is the only option, if this doesn’t work, unfortunately the only way to grade results is call function for each page. We will add multi-page grading in future.

Please feel free to ask for any further assistance.