Unable to get a security group ID by name using Graph API. Error "URI path is not a valid Graph endpoint," inside our Power Automate flow - power-automate

I want to get a security group ID by name, so i tried this HTTP request action, by passing this uri (https://graph.microsoft.com/v1.0/groups?$filter=displayname eq 'SEC-Project Repository Hub-Visitors'):-
but i got this error
{
"error": {
"code": 400,
"message": "URI path is not a valid Graph endpoint, path is neither absolute nor relative or resource/object is not supported for this connector. Resources: groups. Uri: https://graph.microsoft.com/v1.0/groups?$filter=displayname eq 'SEC-Project Repository Hub-Visitors'",
"source": "canada-001.azure-apim.net",
"path": "choose[10]\\when[1]",
"policyId": "",
"clientRequestId": "*****"
}
}
any advice please?

I saw some posts about it. Just put / after groups:
groups/?....

Related

How to get details of high importance mails via Graph API

I am trying to get list of mails that are with high importance via Graph API.
For that, I am using below query:
https://graph.microsoft.com/v1.0/me/messages?$select=importance,subject
But that's not working out as it is giving all :(
I found that I have to add filter in the query and tried like below:
https://graph.microsoft.com/v1.0/me/messages?$select=importance,subject &
$filter=importance eq high
But I'm getting error like below:
{
"error": {
"code": "RequestBroker--ParseUri",
"message": "Could not find a property named 'high' on type 'Microsoft.OutlookServices.Message'.",
"innerError": {
"date": "2022-06-10T04:29:52",
"request-id": "",
"client-request-id": ""
}
}
}
I think I'm using query in a wrong way. Can anyone suggest me what's wrong?
Use single quotation mark '' for the specific name of the importance
https://graph.microsoft.com/v1.0/me/messages?$select=importance,subject&$filter=importance eq 'high'

Send custom error response in Spring Cloud Gateway when no route matches

In Spring Cloud Gateway , I want to send a custom error in case a particular predicate match fails . For eg:-
I have a Path and a header predicate. Something like this -
- id: test
uri: http://localhost:8000/
predicates:
- Path=/consignment
- Header=h,h1
So if the path mathces and header doesn't , the request fails with not found error something like by default-
{
"timestamp": "2020-03-08T20:05:42.440+0000",
"path": "/test",
"status": 404,
"error": "Not Found",
"message": null,
"requestId": "6dd2e799"
}
But I want to send a custom response mentioning that the header is not present.
Is there a way to do that?

" Mandatory fields missing" error while using ServiceNow API

I am using ServiceNow API to create a Catalog request.
URL:
https://<ServiceNow>/api/sn_sc/servicecatalog/items/6e2cc01d4f51ce08d4fb2b8ca310c7a6/order_now
BODY:
{
"sysparm_quantity":"1",
"variables": {
"requestor":"6e2cc01d4f51ce08d4fb2b8ca310c7a6",
"Requested For":"6e2cc01d4f51ce08d4fb2b8ca310c7a6",
"Group Name":"01304c6ddbef9f0827673672399619c4",
"Group Domain":"FG",
"Rationale for Approver Only (this will not be viewed by fulfillment team)":"testing"
}
}
I got this error :
{
"error": {
"detail": "",
"message": "Mandatory Variables are required"
},
"status": "failure"
}
How can I know what are the mandatory fields?
I figured out that this ID will be used to get the mandatory variables.
https://<ServiceNow>/api/sn_sc/servicecatalog/items/<Item_ID>/variables
However, I don't find it on the service now official documentation.
It should be a scripted API.
Check the elements tab in your browser (F12 for Chrome) while you have the form opened and search for "variable_tab" there you will see all expected variables. You can figure out how the mandatory ones are calle by looking at the form.

Error while creating Sales Order with "API_SALES_ORDER_SRV"

we want to create a Sales Order with Cloud SDK (Version 1.9.2) using Virtual Data Model (A_SalesOrder) in our Java Application.
We are calling S4 OnPremise System (1709).
SalesOrder so = SalesOrder.builder()
.salesOrderType("ZKE")
.salesOrganization("DE01")
.distributionChannel("01")
.organizationDivision("00")
.build();
try {
SalesOrder salesOrder = new
SalesOrderCreateFluentHelper(so).execute(endpoint);
} ....
We are getting the following error (while executing via PostMan):
"errordetails": [
{
"code": "CX_SADL_ENTITY_SRVICE_NOT_SUPP",
"message": "The requested service is not supported by entity ~A_SALESORDER",
"propertyref": "",
"severity": "error",
"target": ""
},
{
"code": "/IWBEP/CX_MGW_MED_EXCEPTION",
"message": "An exception was raised",
"propertyref": "",
"severity": "error",
"target": ""
}
]
Can somebody give us a advise to create a Sales Order via the API?
How we can create Sales Order Items for this Sales Order in one Step?
Thanks!
Additional information OData Request Data
(Response Data not provided in ERROR_LOG):
Request-Header / Request-Body:
Apparently we received this error message because we did not include any items in the request. If you give it in your body it worked. Thank you
Can you pls share the OData request and response body and payload?
Open transaction /IWFND/ERROR_LOG, choose the error message and in the lower part of the screen, choose Request Data resp. Response Data and provide us both body and header. Make sure to omit any confidential data.

Using the insert method of the Google Data Transfer API to start a transfer

I am trying to use the transfers:insert method of the Google Admin SDK Data Transfer API. I am performing this API call as the super admin account of my domain. I have verified that API access is enabled for our domain, and that the Super Admin admin role has permission to use the Data Transfer API.
I am testing this in the APIs Explorer on this page.
55656082996 is the ID string that I got for Google Drive from the applications:list APIs Explorer.
Request:
POST https://www.googleapis.com/admin/datatransfer/v1/transfers?key={YOUR_API_KEY}
{
"oldOwnerUserId": "olduser#ourdomain.com",
"newOwnerUserId": "newuser#ourdomain.com",
"applicationDataTransfers": [
{
"applicationId": "55656082996"
}
]
}
Response:
400 OK
- SHOW HEADERS -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid value for: Invalid oldOwnerUserId."
}
],
"code": 400,
"message": "Invalid value for: Invalid oldOwnerUserId."
}
}
I get the same "Invalid value for: Invalid oldOwnerUserId." response no matter if I use email addresses or usernames. I also tried excluding the applicationDataTransfers array from the response, but that also didn't work.
The documentation does not say this, but the Id cannot be the user's email address, like in all of the other Google APIs, but rather it needs to be a numeric ID for the user that you can get using the Users:get Directory API method.
I figured this out by Google searching and coming across this documentation, where they elaborate upon oldOwnerUserId by saying "# ID"
In addition to the answer above.
Here is how you can get the employee' IDs from Gsuite API in Python 3.*
def create_directory_service():
credentials = cls.get_credentials(scopes=['https://www.googleapis.com/auth/admin.directory.user'])
return build('admin', 'directory_v1', credentials=credentials, cache_discovery=Fals
service = create_directory_service()
old_owner_google_id = service.users().get(userKey=old_owner).execute()['id']
new_owner_google_id = service.users().get(userKey=new_owner).execute()['id']

Resources