Android Question Paypal get an access token

Tim Chapman

Active Member
Licensed User
Longtime User
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
    Dim job1 As HttpJob

    job1.Initialize("Job1", Me)
    job1.Username = "Client_ID"
    job1.Password = "Secret"
    job1.PostString("https://api.sandbox.paypal.com/v1/oauth2/token","grant_type=client_credentials")
End Sub

Sub jobdone(j As HttpJob)
    Log("start")
    Log(j)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Log:
[errormessage=, httputils2service=null, jobname=Job1
, password=Secret, req=anywheresoftware.b4h.okhttp.OkHttpClientWrapper$OkHttpRequest@69a7e8c, success=true
, tag=java.lang.Object@e9eb9d5, target=class b4a.example.main, taskid=1
, username=Client_ID]

I am getting success on the job, but no access token in response. Any ideas?

The details of how this should work is here:
https://developer.paypal.com/docs/integration/direct/make-your-first-call/#get-an-access-token
 

ronell

Well-Known Member
Licensed User
Longtime User
B4X:
#Region  Project Attributes
 
    job1.Username = "Client_ID"
    job1.Password = "Secret"
    job1.PostString("https://api.sandbox.paypal.com/v1/oauth2/token","grant_type=client_credentials")
in the link you post , the username and password are in lower case
 
Upvote 0
Top