Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  How to configure credentials of a integration using terraform or API

    Posted 25 days ago

    I need to configure the credentials (client_id and client_secret) for an integration that has already been created in Genesys Cloud. I plan to automate this, so I need to use a tool such as Terraform or an API call.


    #CXasCode
    #Integrations

    ------------------------------
    Jesus Garces
    NA
    ------------------------------


  • 2.  RE: How to configure credentials of a integration using terraform or API

    Posted 24 days ago

    Hi Jesus,

    If you're using Terraform, unfortunately, you cannot modify your integration to configure the credentials if it has already been created. What you can do is create it in your Terraform project with the resource genesyscloud_integration and provide the credentials with the resource genesyscloud_integration_credential.

    If you want to modify via API, you can use the PATCH /api/v2/integrations/{integrationId} to modify the integration in your custom solution and configure the credentials. The rest of the API calls that you might need are also there.

    Hope this helps.



    ------------------------------
    Ralph John Quiaoit
    Software Engineer (Developer Evangelist)
    ralph_john.quiaoit@genesys.com
    ------------------------------



  • 3.  RE: How to configure credentials of a integration using terraform or API

    Posted 16 days ago

    Hi @Jesus Garces

    Here is a sample  integration crendential you can look at.  you can also follow this thread for more information . 

    PS: the expose_client_secret only works when you are creating a new auth client. For an existing auth client adding this attribute will not make any impact because the "read acuth client" will no longer return client secret. Client secret is only exposed during creation.


    data "genesyscloud_auth_division" "New_Home" {
       name        = "New Home"
     }
     
     
     data "genesyscloud_auth_role" "Master_Admin" {
       name        = "Master Admin"
     }
     
    resource "genesyscloud_oauth_client" "hem_Client2" {
      state                         = "active"
      access_token_validity_seconds = 86400
      authorized_grant_type         = "CLIENT-CREDENTIALS"
      name                          = "hem Client2"
      roles {
       division_id = "${data.genesyscloud_auth_division.New_Home.id}"
        role_id     = "${data.genesyscloud_auth_role.Master_Admin.id}"
      }
       integration_credential_name = "new credential"
       expose_client_secret = true
    }
     
    resource "genesyscloud_integration_credential" "credentials_hem2" {
      name                 = "credentials_hem7"
      credential_type_name = "pureCloudOAuthClient"
      fields = {
        clientId     = genesyscloud_oauth_client.hem_Client2.client_id
        clientSecret = genesyscloud_oauth_client.hem_Client2.client_secret
      }
    }






    ------------------------------
    Hemanth Dogiparthi
    Manager, Software Engineering
    ------------------------------