Hello everybody,
I need some way to get new users automatically onboarded and started to play around with the JIRA Cloud REST API but I need some help to get started.
So I need to get authenticated first to send API requests via REST, I’ve already generated an Token for that. And I’ve found the right POST request via curl for creating a new user account. My problem is to get those two combined.
So the curl command for authenticating looks like that:
curl -D- \
-u user@domain.com:API_Key \
-X GET \
-H "Content-Type: application/json" \
https://name.atlassian.net/rest/api/2/issue/createmeta
and the command for creating a new user:
curl --request POST \
--url 'https://name.atlassian.net/rest/api/2/user' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"emailAddress": "new_user@domain.com",
"displayName": "New User"
}'
If I try to authenticate with the first one (seems to work) and use the second command after that, it seems that I’m not authenticated anymore or it is a new session or something like that.
Some help would be appreciated
Thanks!