Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Sending fax via platform Api

    Posted 08-04-2023 12:09
    No replies, thread closed.

    Hi all,

    I am trying to Fax docuemnt from Sales Force through Genesys CTI. But I am getting error (Endpoint is incorrect) , here is my Apex class :

    String clientId = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
    String clientSecret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
    HttpRequest req = new HttpRequest();
    req.setMethod('POST');
    req.setHeader('Authorization', 'Basic ' +
      EncodingUtil.base64Encode(Blob.valueOf(clientId + ':' + clientSecret)));
    req.setHeader('Host','https://apps.usw2.pure.cloud/oauth');
    req.setHeader('content-type', 'application/x-www-form-urlencoded');
    req.setEndpoint('https://apps.usw2.pure.cloud/oauth/token');

     req.setBody('grant_type=client_credentials');

     Http http = new Http();

    try{
        HTTPResponse res = http.send(req);
        System.debug('value of Status code: ' + res.getStatusCode());
        System.debug('value of res: ' + res.getBody());

     

    } catch(System.CalloutException e){
        // do something useful here
    }

    Any thoughts , will be appreciated.

    Thanks


    #Integrations

    ------------------------------
    Bassel Nafaa
    Prospero Management Services, LLC.
    ------------------------------


  • 2.  RE: Sending fax via platform Api

    Posted 08-05-2023 14:39
    No replies, thread closed.

    So, a couple of things here.  First the API endpoint should be https://api.<region>.  You are in the US West region according to the above, so I would assume you should be calling https://api.usw2.pure.cloud.  The Token APIs are /oauth/token, 

    Here is the URL:  Grant - Client Credentials (genesys.cloud)

    Once you get the Token, you can then call the Fax API. 



    ------------------------------
    Robert Wakefield-Carl
    ttec Digital
    Sr. Director - Innovation Architects
    Robert.WC@ttecdigital.com
    https://www.ttecDigital.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 3.  RE: Sending fax via platform Api

    Posted 08-08-2023 11:07
    No replies, thread closed.

    Thank you Robert for your answer and sharing the documents. https://api.mypurecloud.com/oauth/token   did not work but using below URL could fix the issue.

    POST https://login.mypurecloud.com/oauth/token

    Regards



    ------------------------------
    Bassel Nafaa
    Prospero Management Services, LLC.
    ------------------------------