Text

现在我把我们假设的坐标传入进去没有反应

var key = "XXX";

var url = "http://cloud.myscript.com/api/v3.0/recognition/rest/text/doSimpleRecognition.json?key="+key+"&code=XXX";

var data = {

             "components":[

               {

                 "type":"stroke",

                 "x":[

                   133.66668701171875,

                   141.66668701171875,

                   145.66668701171875

                 ],

                 "y":[

                   319.5,

                   299.5,

                   294.5

                 ]

               }

             ],

             "resultTypes":[

               "LATEX",

               "MATHML",

               "SYMBOLTREE"

             ],

             "columnarOperation":false,

             "userResources":[

             ]

           }

已经按照你们的格式传入了坐标但是看到任何回应


Dear olivier,

I found out that our cross-domain don't succeed, may be your server does not allow us to access, now I need you to allow us to visit!

Thank you for always help!

Hu Keke

Dear Hu Keke,

on our side, we are not likely to block that. Which error message do you have? On which server (URL) are you posting your request?

Best regards,

Olivier
Dear Customer,

regarding you request, you are posting a "MATH" request, while posting it on the TEXT url.

For a Math URL, you should post it on the following URL: http://cloud.myscript.com/api/v3.0/recognition/rest/math/doSimpleRecognition.json

Let us know if this helps.

Best regards,

Olivier
Dear Hu Keke,

can you confirm you are posting your request on the following URL: https://cloud.myscript.com?

Best regards,

Olivier

谢谢您的提醒,地址我改过之后现在还是在报400的错误,我们找到原因之后发现是这样的

{result: {message: "Required String parameter 'applicationKey' is not present"}}result:{message: "Required String parameter 'applicationKey' is not present"}
而当我们又重新注册账号之后发现你们不会再给我们新账号里面发密钥等文件,这是为什么呢?

Name


image

Dear Customer,

It seems the API key is not sent into your query.

Please add it properly, and it should work fine.

Best regards,

Olivier

您好,我之前只要引入您们的接口就会报400的错误,我用ajax进行跨域之后现在报的是这个图片的错误

image

当我点开network之后是这样显示的:the request has no preview available。您能帮我分析一下吗?

image

Dear Customer,

I am sorry but your message doesn't help at all.

Can you please provide with the full request you send to the Cloud (ensure you hide the key on the forum)? This will allow us to replay it.

Best regards,

Olivier

现在我们是用的ajax进行数据传输代码是这样的:

var data =  
       {
          "components":[
          {
          "type":"stroke",
          "x":[
          133.66668701171875,
          141.66668701171875,
          145.66668701171875
          ],
          "y":[
          319.5,
          299.5,
          294.5
          ]
          }
          ],
          "resultTypes":[
          "LATEX",
          "MATHML",
          "SYMBOLTREE"
          ],
          "columnarOperation":false,
          "userResources":[
          ]
          }
var key = "XXX";
var url = "http://cloud.myscript.com/api/v3.0/recognition/rest/math/doSimpleRecognition.json?key="+key+"&code=XXX";
$.ajax({
   
  type: 'POST',       //请求方式
//  url: 'http://cloud.myscript.com/api/v3.0/recognition/ws/math',  //请求地址
     url: url,
  contentType : 'application/json;charset=UTF-8',
  data: data,  //请求参数
  dataType: 'jsonp',
     callback: 'callback',
  success: function (data) {
  // 此处放成功后执行的代码
  alert("成功")
  },
  fail: function (data) {
  // 此处放失败后执行的代码
  alert("失败")
  }

   
});


希望您能帮助我们走出困境,万分感谢!

Dear Customer,

Can you please use a "tracker" such as "firebug" and provide with the full query that you are posting and the full response.

Also, please note you can not use the key starting with f4b8e76a (request will be rejected)... You should use the keys that you have on your CDK profile.

Best regards,

Olivier
谢谢您的建议,key我已经改过了firebug我也下载了,不过我现在还是会报错,他们报的是这样的错误,

image

现在我的代码是这样的:var data =  
        {
  "components":[
  {
  "type":"stroke",
  "x":[
  133.66668701171875,
  141.66668701171875,
  145.66668701171875
  ],
  "y":[
  319.5,
  299.5,
  294.5
  ]
  }
  ],
  "resultTypes":[
  "LATEX",
  "MATHML",
  "SYMBOLTREE"
  ],
  "columnarOperation":false,
  "userResources":[
  ]
  }
var key = "3cb31783-7b3e-4226-8a8b-90803bf73f4a";
var url = "http://cloud.myscript.com/api/v3.0/recognition/rest/math/doSimpleRecognition.json?key="+key+"&code=f4b8e76a-993f-4072-90ce-495fd377df97";
$.ajax({
   
  type: 'POST',       //请求方式
//  url: 'http://cloud.myscript.com/api/v3.0/recognition/rest/math/doSimpleRecognition.json',  //请求地址
     url: url,
  contentType : 'application/json;charset=UTF-8',
  data: data,  //请求参数
  dataType: 'jsonp',
     callback: 'callback',
  success: function (data) {
  // 此处放成功后执行的代码
  alert("成功")
  },
  fail: function (data) {
  // 此处放失败后执行的代码
  alert("失败")
  }

   
});


您好:我现在把我们的代码改成这样var data =  
        {
  "components":[
  {
  "type":"stroke",
  "x":[
  133.66668701171875,
  141.66668701171875,
  145.66668701171875
  ],
  "y":[
  319.5,
  299.5,   
  294.5
  ]
  }
  ],
  "resultTypes":[
  "LATEX",
  "MATHML",
  "SYMBOLTREE"
  ],
  "columnarOperation":false,
  "userResources":[
  ]
  }
var key = "3cb31783-7b3e-4226-8a8b-90803bf73f4a";
//var url = "http://cloud.myscript.com/api/v3.0/recognition/rest/math/doSimpleRecognition.json?key="+key+"&code=f4b8e76a-993f-4072-90ce-495fd377df97";
$.ajax({
   
  type: 'POST',   
  async:false,//请求方式
  url: 'http://cloud.myscript.com/api/v3.0/recognition/rest/math/doSimpleRecognition.json',  //请求地址
  data: data,  //请求参数
  dataType: 'jsonp',
     jsonp: 'callback',
     jsonpCallback:key,
  success: function (data) {
  // 此处放成功后执行的代码
  alert("成功")
  },
  fail: function (data) {
  // 此处放失败后执行的代码
  alert("失败")
  }

   
});
但是我不确定jsonpCallback里面的值是不是应该传key,如果不是key,那你们可否给我说一下你们后台返回的是什么样的回调函数名?我这边现在的报错情况是以下这样的:

image

image


 对于您的帮助,我们十分感谢!

不好意思,一直在打扰您,我今天下午发现之前我用的post进行跨域请求没有成功,现在我用php写了一个post跨域请求,好像成功了,不过还是在报这样的错误,

image

感觉自己像是陷入了一个死循环一样,希望能尽快得到您的帮助!谢谢!

 

Dear Hu Keke,


I am sorry, I am not able to read this message. Can you please add the "string" version instead of an image?


Thank you,


Best regards,


Olivier

Login or Signup to post a comment