'https://developer.sumup.com/docs/api/generate-a-token/
Public Sub TestSumupPostURL
Dim Link As String = "https://api.sumup.com/token"
Dim Data As Map = CreateMap("client_id" : "xxxx", "client_secret" : "xxxxx", "code" : "xxxxx", "grant_type" : "refresh_token", "refresh_token" : "xxxxx")
Dim Parameters As String = Data.As(JSON).ToString
Log(Parameters)
Wait For (SumupPostURL(Link, Parameters)) Complete (DataResult As String)
Log(DataResult)
End Sub
Public Sub SumupPostURL(URL As String, Parameters As String) As ResumableSub
Dim Result As String
Dim j As HttpJob
Try
j.Initialize("", Me)
j.PostString (URL, Parameters)
j.GetRequest.SetContentType("application/json")
j.GetRequest.SetHeader("Accept","application/json")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Result = j.GetString
Else
Log(j.ErrorMessage)
End If
Catch
Log(LastException)
End Try
j.Release
Return Result
End Sub