Unable to loop API request from Postman CSV to OKTA - api

I am attempting to use Postman and OKTA API collections to populate group memberships for over 1,000 users and several different groups.
This request works when populating a static group ID and static user ID in the request however any attempts I make to autogenerate the userId from a CSV file continue to fail with "method not supported"
PUT /api/v1/groups/${groupId}/users/${userId}
Sample Curl
curl -v -X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
"https://${yourOktaDomain}/api/v1/groups/00g1fanEFIQHMQQJMHZP/users/00u1f96ECLNVOKVMUSEA"

Related

Paypal API, Curl request, get list of orders of customers

Need a Curl command who can get all transaction_id between two dates.
Exemple :
curl -v -X GET https://api-m.sandbox.paypal.com/v1/reporting/transactions?start_date=2021-12-01T00:00:00-0700&end_date=2021-12-30T23:59:59-0700&transaction_id=XXXXXXXXXXXXX&fields=all&page_size=100&page=1 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer %token%"
But without the transaction_id.
Remove &transaction_id=XXXXXXXXXXXXX from your API call
Preston PHX

How to import json report through automation using REST API and XRay for JIRA and Cucumber + Xray

I can manually import execution result(report.json) through jira and its giving proper status.But i want to achieve through automation i am unable to do so
How to do so
i tried using below curl command in terminal ..was unable to get expected result
curl -H "Content-Type: application/json" -X POST -u username:password --data #report.json http://myurl.net/rest/raven/1.0/import/execution/cucumber
Note that the curl request you showed is tailored for Xray on Jira server and from the screenshot you're showing, it seems that you're using Xray on Jira Cloud. That requires that you have a token that you need to obtain first of all using another request.
If you're doing it by "hand" (i.e. from the command line), you would need to so something like:
token=$(curl -H "Content-Type: application/json" -X POST --data #"cloud_auth.json" https://xray.cloud.xpand-it.com/api/v2/authenticate| tr -d '"')
curl -H "Content-Type: application/json" -X POST -H "Authorization: Bearer $token" --data #"report.json" https://xray.cloud.xpand-it.com/api/v2/import/execution/cucumber
My cloud_auth.json is something like:
{ "client_id": "215FFD69....","client_secret": "1c00f8f2c..." }
Please check in more detail the authentication API and the endpoint for importing cucumber results (there are two actually) in the cloud.

Why I can't delete Link between person and group identities with Platform of Trust's Identity API?

I have created account on Sandbox
I have then created a group with
curl -i -X POST \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d \
"{
\"context\": \"https://standards.oftrust.net/v2/Context/Identity/Group/\",
\"type\": \"Group\",
\"data\": {
\"name\": \"Company Oy\"
}
}" "https://api-sandbox.oftrust.net/identities/v1"
I have also created a Link between person and group, I used MemberOf
curl -i --request POST \
--url https://api-sandbox.oftrust.net/identities/v1/{fromIdentityId}/link/{toIdentityId} \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'content-type: application/json' \
--data '{
"context": "https://standards.oftrust.net/v2/Context/Link/Role/MemberOf/",
"type": "Member"
}'
I got successful response that link was created between those identities.
Trying to delete this link now, but I get as response 404 and message Link not found.
What I try is according with example from documentation
curl -i -X DELETE \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
"https://api-sandbox.oftrust.net/identities/v1/{fromIdentityId}/link/{toIdentityId}/MemberOf"
[UPDATE]: I discovered also in Identity API documentation that can list all links of identity.
And have made this for group identity:
curl -i -X GET \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
"https://api-sandbox.oftrust.net/identities/v1/<group_id>/links"
The response shows that link between group and person identities.
Firstly, make sure you respected the id values (their order) for From and To. They should be the same you get in response of https://api-sandbox.oftrust.net/identities/v1/<group_id>/links
Secondly, delete Link endpoint needs to be used with a type, as exemplified. In this case MemberOf. But looking at the creation of the link there is a typo: context used is correct, but the type is Member. Type should match the last part of the name in context => MemberOf
In this case, since you are trying to delete it, simply use Member
curl -i -X DELETE \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
"https://api-sandbox.oftrust.net/identities/v1/{fromIdentityId}/link/{toIdentityId}/Member"

OneLogin API credentials

Im trying to make a basic call to the ONELOGIN API. After generating the cliend ID and secret with MANAGE ALL permissions, im still unable to connect
Generated correctly the ID and secret with the right permissions as per official documentation
curl 'https://api.us.onelogin.com/auth/oauth2/v2/token' \
-X POST \
-H "Authorization: client_id:, client_secret:" \
-H "Content-Type: application/json" \
-d '{
"grant_type":"client_credentials"
}'
i expected to connect, instaead the output is
{"status":{"error":true,"code":401,"type":"Unauthorized","message":"Authentication Failure"}}

Get image list using Orange Cloud API

Using the endpoint /folders of the Orange Cloud API, I can only get the listing of the files in the main directory:
curl -X GET -H "X-Orange-CA-ESID: OFR-2588c...2e64f249ab" -H \
"Authorization: Bearer OFR-2588c...2e64f249ab" \
https://api.orange.com/cloud/v1/folders/Lw
How could I get photos entries only, including the ones in subdirectories?
You can get all photos this way:
curl -X GET \ -H \
-H "Authorization: Bearer OFR-948ef5..." \
"https://api.orange.com/cloud/v1/folders?filter=image&flat=true"
By the way, the session header is no more necessary
https://developer.orange.com/apis/cloud-france/getting-started#filtering-on-photos,-videos,-audio-files