Legacy Dev Forum Posts

 View Only

Sign Up

Using SAS Proc HTTP to Request Auth Token

  • 1.  Using SAS Proc HTTP to Request Auth Token

    Posted 06-05-2025 18:26

    DaveShea | 2023-06-13 23:50:17 UTC | #1

    Hi, I am very new to GenesysCloud and this Forum, be gentle with me.

    I am trying to use SAS to connect to Genesys Cloud. At this stage, I simply want to just get an Auth Token, but am getting a 400 Bad Request.

    From other postings on this forum, I have seen respondents asked for the Correlation ID when a user has reported a problem. From the DEBUG info that comes back from SAS Proc HTTP, I see the following which I hope is the right thing:

    Inin-Correlation-Id: 23ff73b6-4d85-4385-5330-22925bae17f0

    I read from the Genesys Cloud documentation that the ClientID/ClientSecret pair that I have been supplied with, needs to be presented in the request in Base 64 Encoding and I believe that I have done that OK.

    The ProxyHost has been opened up to allow out-bound traffic and I believe that the DEBUG info shows that.

    I tried to paste the DEBUG info into this post but I got an error that said "new users can only include two links in a post", so I am a bit stuck as I was not aware I was posting any links. I have removed the DEBUG info and just left the original SAS Proc HTTP step below in the hope that this gets through OK.

    C'est la vie.

    Whilst I appreciate not everyone knows SAS, if it helps, the SAS Proc HTTP step that was run looks like this (with the ClientID, ClientSecret and ProxyHost mangled for the purposes of this post. Proc HTTP Method = "POST" AUTH_BASIC WEBUSERNAME ="ThereisNothingLikeADameTakeMeOutToTheBallParkDarling" WEBPASSWORD ="WhatCanAManDoWhenAManCanDoNothingButWaitAndConsiderHisOptionsNow" URL = "<my PureCloud Link was here>" ProxyHost = "myproxyservername.xyz.co.mm" ProxyPort = 443 ; HEADERS "Content-Type"="application/x-www-form-urlencoded"; DEBUG LEVEL = 1;

    Run;

    Any thoughts ?

    Dave Wellington.


    Eos_Rios | 2023-06-14 03:00:31 UTC | #2

    What URL are you using to post to?

    Off hand, I think AUTHBASIC is wrong, because of the proxy you'd probably need to use PROXYAUTH_BASIC so your headers go to the destination, not the proxy itself, though some proxies will do that for you.

    I'm also not seeing your actual form content, ie: the grant_type you're asking for, not sure if you intentionally omitted or the lack of it is your problem, but not having it would definitely cause a 400 failure;

    in='grant_type=client_credentials'

    system | 2023-07-15 03:00:33 UTC | #3

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 20425