Home Man
Search
Today's Posts
Register

Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

CurL command Rest API call with oauth 2.0 secutity error

Tags
ip networking

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 05-14-2018
CurL command Rest API call with oauth 2.0 secutity error

Hi


I need to get rates for different security form REST API . the API is oauth 2.0 secured.

i need to use curl command to get json response from api .


token URL - is HTTP
data URL is - HTTPS


when trigger my command from bash script it passing and failing intermittently with following error

with error could not resolve host for curl command (exit code 6). It is stopping me from proceeding .


my command for token :

Code:
RTOKEN=$(curl -X POST $RTOKENURL -u $RCLIENTID -d "grant_type=client_credentials" -d "code=client_credentials" | grep token | cut -d, -f1 d\" -f4)


For data with above token

Code:
curl -k -o $INDIR/$IFILENAME --request GET --url $RDATAURL$RTOKEN --header 'authorization: Bearer'$RTOKEN.


so the problem is intermittent so some time i get my data in file and sometimes it fails with above error please help...


Please Note :- same URLS are working fine with POSTMAN(chrome) always.
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Working web service call not working with curl abigbear Shell Programming and Scripting 3 08-13-2017 03:02 PM
Rest APIs without curl in shell script rv_champ Shell Programming and Scripting 3 02-02-2016 12:31 PM
Error on executing soap request using Curl command siramitsharma Web Programming 2 09-29-2015 12:25 PM
Curl command rakeshtomar82 Shell Programming and Scripting 1 04-09-2015 07:15 AM
Help with curl command dunryc Shell Programming and Scripting 4 09-13-2014 03:49 PM
Curl --cert to call a servlet subhransun UNIX for Dummies Questions & Answers 0 09-12-2014 12:11 PM
perl: CURL REST API Query 3246251196 Shell Programming and Scripting 1 03-22-2013 04:36 PM
web service call: curl output to xsltproc input webuser Shell Programming and Scripting 3 07-16-2011 09:48 AM
curl command with web pages Straitsfan UNIX for Dummies Questions & Answers 2 06-04-2009 12:10 PM
Curl command protocomm Shell Programming and Scripting 1 03-26-2009 01:49 AM


All times are GMT -4. The time now is 08:34 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password