Skip to Content
0
Jan 28, 2020 at 08:18 AM

How to use "OAuth 1.0 class/method" in abap (Twitter API)

217 Views

Hi,

I tried to connect TWITTER in ABAP. so, i used "CURL" below :

CONCATENATE
'curl -i -X POST'
' -H "Content-Type: application/x-www-form-urlencoded"'
' -H "User-Agent: OAuth gem v0.4.4"'
' -H "Authorization: OAuth oauth_consumer_key=our_oauth_consumer_key, oauth_token=our_oauth_token, oauth_signature_method=HMAC-SHA1,'
'oauth_timestamp=1578965221,oauth_nonce=oauth_nonce_value,'
'oauth_signature=' lv_oauth_signature '"' 
' "https://ads-api.twitter.com/6/accounts/12aal5/tailored_audiences?name=audience_name"'  
INTO cmd.

but i've got "401 Authorization Required". when i used POSTMAN, it was successed.

I think there is a problem in the process of making oauth or there is an error in curl syntax.

(twitter api :

https://developer.twitter.com/en/docs/basics/authentication/oauth-1-0a/creating-a-signature)

According to google, there is a class in SAP GUI.

https://www.se80.co.uk/oo-abap/c/cl_a/cl_ar_fnd_jam_oauth1_common.htm

I have to authenticate ads API using OAuth 1.0a. Do those methods work the way I want them to?

If it does, please share the example regarding of OAuth 1.0a.

Thanks