Unix/Linux Go Back    


IP Networking 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

IP Networking


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 1 Week Ago   -   Original Discussion by shobhit.working
shobhit.working's Unix or Linux Image
shobhit.working shobhit.working is offline
Registered User
 
Join Date: May 2018
Last Activity: 14 May 2018, 6:05 AM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Rest APIs without curl in shell script rv_champ Shell Programming and Scripting 3 02-02-2016 12:31 PM
Curl --cert to call a servlet subhransun UNIX for Dummies Questions & Answers 0 09-12-2014 12:11 PM
Need help on my LED REST API aoiregion Programming 0 07-25-2014 12:41 AM
perl: CURL REST API Query 3246251196 Shell Programming and Scripting 1 03-22-2013 04:36 PM



All times are GMT -4. The time now is 12:40 PM.