Group IDs associated with the agent

Hello,

Have struck out trying to find the solution to this, hope someone has an answer to this.
My little app sends an api post to Microsoft Power Apps. Problem Im having is reciveing 1 part of that api call, and that is group ID’s. Any one know how the JSON schema would look like for groupIds?

Im sending this - according to “requestbin.com

“agentgroups”: “77000014385,77000016465,77000117723”

In Power Aps, it is meet by
“agentgroups”: {
“type”: “string”
}

I know it should not state string here, but I cannot figure our what it should say.
As I’ve read on the Freshdesk dev site:
group_ids - array of strings - Group IDs associated with the agent.

Any idea?

Not sure if this helps, but array of strings means - ["string1", "string2",..]

1 Like

Hello,

It did, I realized I needed to use the little brackets when sending a array over api.
Part of my api string -> “agentgroups”: [${agentgroups}}

Otherwise is does not seams to be an array when arriving on the other side.

Im trying to shorten script, but I can not figure out on how to shorten this part.
The Idea is that only agents that are in some groups are allowed to use the script.
I extract the group ids then check the via if statements. But would like it to be ONE if statement.

Is that possible? Ideas anyone?

        const numbers = `${payload2.loggedInUser.group_ids}`
        const groupa = numbers.includes(1212121212)
        const groupb = numbers.includes(3434343434)
        const groupc = numbers.includes(4545454545454)
        
        if (groupa){ // Group A
          
        }     else if(groupb){ // Group B
                        
        }     else if(groupc){ // Group C

		} else {

endscript
}