Hello. I am new to Okta and am trying to get familiar with the API. I was working on a script that could create multiple Groups in our new Okta tenant but with the way the curl command is formatted my array variable is not being read. I’ve used other APIs but not one that seems to require this kind of formatting. The variable is just read as plain text and a Group is made with the name of the variable. Here is my script for reference. Thanks in advance!
#!/bin/bash
array=("IT" "Engineering" "Finance")
for i in "${array[@]}"
do
curl POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS $api_key" \
-d '{
"profile": {
"name": "$i"
}
}' "https://$oktadomain/api/v1/groups"
done```