The api call works on postman but when i am trying...
# general
y
The api call works on postman but when i am trying to make a javascript call, it fails
c
writing your own code or copied the postman code for API call?
y
Own code
Javascript on jsfiddle
And on mongodb realm
Serverless function
c
that's easier way to make it work
if its working in postman then you can directly copy the code from there
here is the icon for code generated by postman
y
This gives the curl
But as its oauth 1.0, the curl calculates the nonce, signature etx..
c
there are many languages available and can make changes to it
y
Thanks
This helped
Its erroeing out because of cors error
c
whats the error?
y
Cors
b
the serverless function shouldnt have a cors problem
y
There the authentication fails, i am copying code from postman
b
copying code from postman is unlikely to help you here
you are copying a previous request, and oauth 1 is specifically designed to prevent that
y
I have improvised the code. I am using rhe same credentialz. We are generating new header as per oauth 1.0
But using the same user key, secret, token and token secret
b
i will not debug homemade oauth 1.0a unless you try using a library first
my general recommendation for javascript is https://www.npmjs.com/package/oauth-1.0a
y
I used the library
b
what do the details from TBA and the Login Audit Trail say
y
I dont have acxess to the login audit trail
I am building an application foe thr customer.
I have been provided with thr credds
b
ask them to help you out
y
Ok
Thank you for the help