Re: Rest API Errors

Anonymous
Not applicable

Rest API Errors

Hey all,

Forgive my layman speak...I'm trying to help out a developer co-worker who's trying to set up an API connect to pass leads to our instance of Marketo from a non-Marketo page/site. Does anyone have thoughts as to why we'd be getting the error on the attached screenshot?

Thanks for the help.
0EM50000000SL7W.jpg
Tags (1)
6 REPLIES 6
Anonymous
Not applicable

Re: Rest API Errors

I need a little more info to help here. Is this a screenshot from the JavaScript console? 

I would also recommend taking a look at this help article. It shows you how to do a server-side post: https://community.marketo.com/MarketoResource?id=kA650000000GsXXCA0
Anonymous
Not applicable

Re: Rest API Errors

I believe that this was client-side, and that screenshot was just of the developer tools window in Chrome. I think we'll try the server-side approach. Thanks.
Anonymous
Not applicable

Re: Rest API Errors

You can use a php proxy page to fetch data with javascript as a work around.


Anonymous
Not applicable

Re: Rest API Errors

Try... dataType: 'jsonp'

That got me past that error but now I get this error: Uncaught SyntaxError: Unexpected token :

Any advice?
Yaron_Meiner
Level 2

Re: Rest API Errors

I am having the same issue. I am trying to avoid server activity on ajax calls to marketo which means that i have to pass the gap of the cross origin issue. Is there a way to get the response wrapped for jsonp? 
Anonymous
Not applicable

Re: Rest API Errors

I'm having a similar problem as I'm trying to develop a client-side browser-based REST API interface. The marketo server is on a different domain, so I'm getting the same cross-domain related error as the OP. Does the marketo REST API support any workarounds such as CORS or JSONP?