<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00007pJ0ohCACOkta Classic EngineIntegrationsAnswered2025-03-15T09:01:30.000Z2022-07-14T06:28:37.000Z2022-07-25T15:16:32.000Z

a20kq (a20kq) asked a question.

Update Application Group Profile Using API

Hoping someone can help.

 

I have Okta integrated with SalesForce. I can assign groups to the SalesForce app in Okta. For each group, I can customize the SalesForce Profile, Role and Permission sets.

 

I can export the application group and permission sets by using the apps api e.g.

 

GET /api/v1/apps/${aid}/groups/${gid}

 

The resulting object will show me the profile e.g.

 

role               : 

salesforceGroups         : {PermSet1, PermSet2, PermSet3}

city               : 

profile             :Web Team

postalCode            : 

companyName           : 

featureLicenses         : 

division             : 

Is_Call_Center_User__c      : 

street              : 

NVMConnect__IsActiveOnDialler__c : 

state              : 

department            : 

publicGroups           : 

NVMContactWorld__NVM_Agent_Id__c : 

 

What I want to be able to do is update the profile, licenses etc. using an API call. Has anyone done something similar and could help me with the right API call?

 

I've looked at the Groups API. I don't think this will work In part because they're syncrhonized from Active Directory. But also I want to modify the app profile.

 

Any help appreciated.

Thanks


  • Mihai N. (Okta, Inc.)

    Hi @a20kq (a20kq)​ , Thank you for reaching out to the Okta Community!

     

    Just ran a test in my environment with an Okta Group assigned to my Salesforce sandbox and it worked. 

    I've switched the role from "CEO" to "COO" and back successfully. 

    Pasted Graphic 

    You'll need to confirm that the attributes that you are trying to change are editable and (depending on the attribute) that the new values match exactly what is expected. 

    In the example I've given above, for the role attribute I could only use values from a predefined list. 

     

    If my answer helped, remember to mark it as best to increase its visibility for other members of the Okta Community who might have the same questions as you. 

     

    Hope it helps! 

    Expand Post
  • Mihai N. (Okta, Inc.)

    One thing to note: If you are checking to confirm the changes took place by visual confirmation in the Okta Admin Dashboard, make sure to give it a few seconds and refresh the page, then check.

  • a20kq (a20kq)

    Thanks for testing it out. I still can't get it to work in my environment. I'm trying to script it using Powershell which may be a factor.

     

    If I set the role manually via the dashboard, then run a GET request against the app group. I can see the profile.

    Image is not available
    I 've saved the profile json into a $body variable.

    Image is not available
    Then I try a PUT request using $body as the body. You can see in the response that all values in the profile return as null.

    Image is not available
    Running a subsequent GET request shows that all profile attributes are now null.

    Image is not available
    I'm finding that regardless of what I put in the body of the PUT request, all profile attributes are set to null.

    Any ideas?

    Expand Post
  • a20kq (a20kq)

    This is resolved. Posting the solution for anyone it might help.

    I tried with Postman and was able to update the profile successfully.

     

    I went back to my Powershell script and tried again.

     

    It seems that the cmdlet I was using was not properly converting the PSOjbect into JSON (maybe I was wrong to think it would). Once I formatted it as JSON first then sent it as the body, I was able to change the object in Okta.

     

    Instead of sending the body as $body, I first converted it to a JSON string.

     

    $body = $body | convertto-JSON

     

    $result = Invoke-RestMethod $requestUrl -Headers $headers -Method Put -Body $body

     

    I'm sure I tried this before but initially I got a 400 error so thought it was improperly formatted. Turns out the 400 related to an attribute that was not present in this SF instance in Okta. This was highlighted using Postman. Once I removed the attributes, I got a 200 status and the object was updated successfully.

     

    Happy days.

    Expand Post
    • Mihai N. (Okta, Inc.)

      Sorry for the late reply! I was out of the office last week.

      Happy to "hear" that it was sorted! 👍

This question is closed.
Loading
Update Application Group Profile Using API