I am looking to call Zoom from Salesforce by calling the API directly, as I need to make some calls in a Flow that isn’t supported by the Zoom marketplace app in Salesforce.
Here is what I’ve gotten in Salesforce so far:
- Created a named credential with JWT Tokens (I believe this is wrong though)
- Created an External service with the Zoom APIs, specifically for the report/users/{0}/meetings endpoint.
- Created a flow to call the above endpoint
When running the flow, this is the error I get:
Error Occurred: Unable to map response for parameter: 200 and invokable action: Zoom2.reportMeetings. Received response:
(note the blank "received response")
My first inclination is that my named credential to set up the JWT token was incorrect.
Has anyone on this forum had success creating a named JWT credential on Salesforce to call Zoom? I’ve successfully used JWT tokens in other apps but am not sure if I’m mapping things correctly in Salesforce.
Hi Jeremy, I have used a JWT app to connect to the Zoom API with Apex. I have the client id/secret stored in a custom setting. Here is the relevant Apex that generates the token I use to make API calls. I haven't used Flow to make API calls but this could be created as an invocable method you could call from Flow. Hope it helps.
public static String createToken() {
String token='';
String alg = 'HS256';
String typ = 'JWT';
String headerJson = JSON.serialize(new Header(alg,typ));
String iss = ZoomAPI__c.getOrgDefaults().ClientID__c;
String exp = String.valueOf(System.currentTimeMillis() + 60 * 60 * 1000);
String bodyJson = JSON.serialize(new Body(iss,exp));
token = EncodingUtil.base64Encode(Blob.valueOf(headerJson))
+ '.' + EncodingUtil.base64Encode(Blob.valueOf(bodyJson));
String signature = EncodingUtil.base64Encode(Crypto.generateMac('HMACSHA256',
Blob.valueOf(token),
Blob.valueOf(ZoomAPI__c.getOrgDefaults().APISecret__c)
);
token += '.' + signature;
return token;
}