I'm trying to query dremio using the documented API to get list of users.
Dremio version:
Build
20.2.2-202203241726030461-f7eea3e0
Edition
Enterprise Edition
API:
https://docs.dremio.com/software/rest-api/user/list-users/
sample query:
curl -X GET --location "http://localhost:9047/api/v3/user" \
-H "Authorization: _dremiohrr395nv31g8k610616tucp91g" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
I keep getting this error:
{
"errorMessage": "Something went wrong. Please check the log file for details, see https://docs.dremio.com/advanced-administration/log-files.html",
"moreInfo": "HTTP 405 Method Not Allowed"
}
It seems that this API is not supported at all.
Is there a published API to list all users so that I can get user name, uid, and role memberships?
I'm trying to avoid using SQL query.
v3 list users API is buggy.
user apiv2/user works
Related
I want to create TeamCity users with various roles through the API. As long as I provide no role, I know how to do it, like so:
curl -X POST http://localhost:8111/app/rest/users \
-H "Content-Type: application/json" \
-d '{"username":"user", "password":"password"}' \
-u :<super-user-token>
Now, my issue is that e.g. I want to create an administrator. I tried this:
curl -X POST http://localhost:8111/app/rest/users \
-H "Content-Type: application/json" \
-d '{"username":"user", "password":"password", "roles": {"role": [{"roleId": "PROJECT_ADMIN"}]}}' \
-u :<super-user-token>
The roleId is a value that comes from the roles-config.xml file in folder <TeamCity Data Directory>/config, should be fine. I get the following error:
Responding with error, status code: 400 (Bad Request).
Details: jetbrains.buildServer.server.rest.errors.PartialUpdateError: Partial error updating user 'zadigus' {id=3}, nested errors: jetbrains.buildServer.server.rest.errors.PartialUpdat
eError: Partial error updating roles for user 'zadigus' {id=3}, nested errors: java.lang.IllegalArgumentException: Argument for #NotNull parameter 'scopeData' of jetbrains/buildServer/
server/rest/model/user/RoleAssignment.getScope must not be null
There was an error processing the request, but the data could be updated partially. Please ensure consistent data state.
because I provide no scope. I was not able to find any information about what values I can feed the scope field with. Where are they documented?
I am using TeamCity version 2022.04.4.
I found it. In order to get the possible values for the scope field, just run
curl -X POST http://localhost:8111/app/rest/users \
-H "Content-Type: application/json" \
-d '{"username":"user", "password":"password", "roles": {"role": [{"roleId": "PROJECT_ADMIN", "scope": "invalid-value"}]}}' \
-u :<super-user-token>
In the reply to this request, we get the information that possible values are either g or p:<projectId>.
I want to list (count actually) the comments made on a GitHub pull request.
As per the documentation, I am using the following curl command to hit the GitHub API
curl -H "Accept: application/vnd.github+json" -H "Authorization: token abcdefg123457" https://api.github.com/repos/MyOrg/MyRepo/pulls/2/comments
The result is the following:
[
]
despite me seeing comments on #PR2.
What am I missing?
curl -X GET "https://test.api.amadeus.com/v1/shopping/flight-dates?origin=LON&destination=NYC&departureDate=2022-10-01&oneWay=true&nonStop=false&viewBy=DATE" -H "accept: application/vnd.amadeus+json" -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXX"
it is under internal analysis. The service will return soon in Test environment.
https://github.com/amadeus4dev/amadeus-code-examples/blob/master/flight_cheapest_date_search/v1/get/curl/flight_cheapest_date_search.sh
curl -X GET "https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MAD&destination=MUC" -H "Authorization: Bearer $ACCESS_TOKEN" -k
{"errors":[{"status":404,"code":6003,"title":"ITEM/DATA NOT FOUND OR DATA NOT EXISTING","detail":"No price result found"},{"status":404,"code":6003,"title":"ITEM/DATA NOT FOUND OR DATA NOT EXISTING","detail":"No price results found for input combined criteria"}]}
I'm developing an app, for store fronts and want to get some analytics in checkout. So I want to inject a script in that scope of checkout. When I try to insert it I'm getting "You don't have a required scope to access the endpoint" but I have updated the scopes to checkoutcontent to modify. Not sure what else is wrong
Trying to insert script via an app, getting 403 even though I updated the OAuth scopes to include, Check out content and Checkout
curl --request POST \
--url https://api.bigcommerce.com/stores/{store_hash}/v3/content/scripts \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-auth-client: XXXXX' \
--header 'x-auth-token: XXXXX' \
--data '{"name":"Test Scripts Tag","description":"Test Scripts Tag","html":"<script src=\\\"https://Somedestination/Test.js\\\"></script>","src":"https://Somedestination/Test.js","auto_uninstall":true,"load_method":"default","location":"footer","visibility":"checkout","kind":"src"}'
Getting below error, while expecting a status=200
status: 403,You don't have a required scope to access the endpoint
The html field shouldn't be included when using src, could you try removing it?
The only errors I was receiving in testing were due to malformed HTML in the html field with the error code 422. It may also be worth trying to create a new API account to rule out scoping causing this.
I'm working on an app using Pushbullet's API, but I'm running into odd errors when running through the sample code at https://docs.pushbullet.com/v2/pushes/.
I'm executing the following cURL command (in Windows):
curl -k -u <MY_API_KEY>: -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"type": "note", "title": "Note Title", "body": "Note Body"}'
...but it keeps generating the following error:
{"error": {"type":"invalid_request","message":"The param 'type' has an invalid value.","param":"type","cat":"\u003e:3"}}
It also produces this error:
The other commands for the other endpoints in the documentation work fine...it's just this one.
Got any suggestions? Thanks for the help! :)
It looks like windows doesn't support those kinds of quotes on the command line. Here's an example that works:
curl https://api.pushbullet.com/v2/pushes -X POST -u <access token>: --header "Content-Type: application/json" --data-binary "{\"type\": \"note\", \"title\":\"Note Title\", \"body\": \"Note Body\"}"
I think I'm going to try to replace the curl examples with something that has less confusing behavior.
I figured it out - I don't really know why, but the cURL command wasn't working through the DOS prompt, and also wasn't working using the Postman REST client for Chrome, but I got it working in the DHC extension for Chrome. The trick was setting the Authorization header to "Basic", which resolves the Pushbullet access token to some other form, and makes a successful the HTTP request.
Hope this helps someone down the road if they run into this on Windows!