I have successfully got a VBA script to request Call Logs for my company. However, I have been using the Bearer token that is generated by the 'Try It Out' button. I want to run this script automatically so I generated a JWT Token and added it into my requestHeader as the token generated seems to expire after an hour or so. I then switched my app to use JWT auth flow, however, it is not quite right and now I can't switch back to Password-based for testing. Please let me know what I am missing from my code.
EDIT: I tried with curl and it gives me OAU-149 Invalid token. I have double checked that it copied correctly and even generated a new JWT token. Neither work in curl either :(
dateVars = Format(Date - 1, "YYYY-MM-DD") Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1") Url = "https://platform.ringcentral.com/restapi/v1.0/account/~/call-log?direction=Inbound&direction=Outbound&type=Voice&view=Detailed&withRecording=false&dateFrom=" & dateVars & "T14%3A00%3A00.000Z&dateTo=" & dateVars & "T13%3A59%3A00.000Z&page=1&perPage=100" objHTTP.Open "GET", Url, False objHTTP.setRequestHeader "accept", "application/json" objHTTP.setRequestHeader "authorization", "Bearer <JWT TOKEN HERE>"