My requirement is to fetch the OnPremisesDistinguishedName attribute of a user object via Microsoft Graph API.
After doing some extensive R & D I have observed that in the blog post
https://social.technet.microsoft.com/Forums/lync/en-US/df2b1b2b-a7ca-4b34-9ddf-82ffd78fc96e/how-to-retrive-ou-details-in-scripts-that-are-synced-with-office-365-with-aadc?forum=onlineservicesexchange
the same can be achieved via the powershell module as
Get-AzureADUser -SearchString <any string> | select -ExpandProperty ExtensionProperty)["onPremisesDistinguishedName"]
However how can this be achieved via GraphAPI ?
Any thoughts?
onPremisesDistinguishedName exist from January 2019.
API DOC.
Graph API doesn't provide the onPremisesDistinguishedName property.
Currently, we can get the following properties related to onPremises: onPremisesDomainName,onPremisesExtensionAttributes,onPremisesImmutableId onPremisesLastSyncDateTime,onPremisesProvisioningErrors,onPremisesSamAccountName
onPremisesSecurityIdentifier,onPremisesSyncEnabled,onPremisesUserPrincipalName
Call the graph api like this:
https://graph.microsoft.com/v1.0/users/test#test.onmicrosoft.com/?$select=onPremisesDomainName,onPremisesDistinguishedName
Because no property named onPremisesDistinguishedName, so although we add it to the query but it will be ignore.
If the above properties doesn't suit your requirement, you can submit an feature request in the user vocie.
More information for your reference: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/user
Related
Is there a way to list users and filter only real person account using MsGraph users API ?https://graph.microsoft.com/v1.0/users
Currently, it returns person but also conference rooms and others.
I see that you can retrieve persons you work with using people API:
https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/people?$filter=personType/class eq 'Person' and personType/subclass eq 'OrganizationUser'
Is there anything similar for users ?
Thanks you !
The current options are to either use the People API like you said or the List orgContacts endpoint from the Microsoft Graph Rest API Beta.
GET https://graph.microsoft.com/beta/contacts
This returns the list of organizational contacts for the organization.
I am trying to use the function BUILD_SCOPED_FILE_URL on unstructured data(excel sheets). I have uploaded these sheets on Snowflake internal stage and have made use of the Put command to do so.Also to note the stage "hyperion_stage" I created is a default internal stage and no encryption is enabled.
Below are the steps I followed:
//Creating internal stage
create stage hyperion_stage;
//Uploading a test file in the stage
put file:///Users/rshrivastava/Downloads/hlvguide.csv #hyperion_stage/ AUTO_COMPRESS = FALSE;
//I can see the file loaded in the stage.
list #hyperion_stage;
+--------------+--------------+-------------+-------------+--------------------+--------------------+----------+---------+
| source | target | source_size | target_size | source_compression | target_compression | status | message |
|--------------+--------------+-------------+-------------+--------------------+--------------------+----------+---------|
| hlvguide.csv | hlvwfhguide.csv | 183548 | 183552 | NONE | NONE | UPLOADED | |
+--------------+--------------+-------------+-------------+--------------------+--------------------+----------+---------+
//Trying to build the URL using the build_scoped_file_url snowflake function
select build_scoped_file_url(#hyperion_stage,'hlvguide.csv');
I get the below link
https://*******.us-west-2.privatelink.snowflakecomputing.com/api/files//238605147195925253/GVsjFXHq5vE7DVmEjo0Ql2WsLNHXfc6nQ8J5NoCPGZ9f6R8QeunEZtqPtsBiPcA6EmqFW810cWmP3hyom9Ky5ox82eucyUVpemM0FejbfYxYo5Ellq0%2bGqyTiNOHN%2fInH%2bOxNzOKvyJZSU7sy08t%2bubFNNNshoIXTrOz1MkmMm%2fjwxl81MuqPDCK5GEdZr6noiOhOHLbmTQ3QKQMNAZhrm00zjF6lNc%3d
When I try to copy this link and put it in the browser, I am getting 403 forbidden error. I tried with other browser as well and the result is same. Does this works or if I am missing any of the steps above?
enter image description here
The reason you are getting this error is because you need to provide authentication.
Below are the two items you can try:
1>Open snowsight, follow the steps are you described above and click the link within snow sight, you should not see an error.
2> This URL is a rest API that needs authentication.Authenticate to Snowflake via the Snowflake SQL API using OAuth or key pair authentication. Then after you can call this GET URL through curl or any application program.
https://docs.snowflake.com/en/developer-guide/sql-api/authenticating.html#label-sql-api-authenticating-key-pair
Happy tshooting!!
It's described in the documents:
https://docs.snowflake.com/en/sql-reference/functions/build_scoped_file_url.html
This function generates a scoped Snowflake-hosted URL to a staged
file using the stage name and relative file path as inputs.
You can access files in a stage using either of the following methods:
1- Retrieve a scoped URL in Snowsight. Click on the scoped URL in the results table.
2- Send the scoped URL in a request to the REST API
for file support. When users send a scoped URL to the REST API to
access files, Snowflake performs the following actions:
Authenticate the user. Verify that it was the current user who called the BUILD_SCOPED_FILE_URL function and generated the scoped
URL.
Verify that the scoped URL is not expired.
Redirect the user to the staged file in the cloud storage service.
This is why you can download the file in Snowsight, and you get "403 Forbidden" message when you try to access it directly.
.I am trying to create a data fusion pipeline which fetches data from pub sub and the used projection to convert message into string (as told by you) and thens ave it to GCS.
howeer,its giving me error: Parameter subscription must conform to pattern ^projects/[^/]+subscriptions/[^/]+$
I am using correct topic and subsctiption name projects/test/subscriptions/dataFusionSubscribe projects/test/topics/DataFusionTopic
You don't need to include the full subscription and topic name in the config, you only need to provide project id as test, subscription id as dataFusionSubscribe, and topic as DataFusionTopic
Attached is a screenshot showing the config for the Pubsub
I need to get a list of groups that the user is a member of using Microsoft Graph API.
For this, I am using the endpoint POST /users/<userId>/getMemberGroups (doc). This works fine but the problem is that the response is only a list of group object ids. I need to get group properties too. I could just loop through the list and query API for GET /groups/<groupId> but this takes too long when the user has multiple groups.
Then I found POST /directoryObjects/getById (doc) which turns that list into what I need. I have followed the doc page exactly but I am getting the following error:
Request_BadRequest - Specified HTTP method is not allowed for the request target. (HTTP status 405)
What am I doing wrong? Is the method getById bugged? If it is, is there any alternative way to turn a list of group object ids into groups or to get full list of user groups?
The API Get directory objects from a list of ids you mentioned should work, I test it in the MS Graph Explorer, it works fine.
Make sure you use POST method, I can reproduce your issue with another method.
You could refer to the informations below and try again.
Request URL:
POST https://graph.microsoft.com/beta/directoryObjects/getByIds
Request Body:
{
"ids": [
"xxxxxxxx-9f1b-4f28-a408-xxxxxxxxxxxx",
"xxxxxxxx-a614-4335-81eb-xxxxxxxxxxxx",
"xxxxxxxx-e500-49d6-a705-xxxxxxxxxxxx",
"xxxxxxxx-5be3-41eb-864d-xxxxxxxxxxxx",
"xxxxxxxx-961d-4db9-87cf-xxxxxxxxxxxx",
"xxxxxxxx-93bf-4950-8d96-xxxxxxxxxxxx"
],
"types": [
"group"
]
}
Result:
Hi I'm started the web development in Amazon MWS. I need to integrate the get category list, add product, list product etc in my application. I have referred the documentation, http://docs.developer.amazonservices.com/en_IN/products/Products_Overview.html But, in that document there is no option to get all the categories, sub categories in mws. And also i have referred several sites, they told me to refer the Browse Tree Report in MWS Api. But, there is no section in the report section. Is Amazon MWS have something like "Get Categories" method, or is there any way to do this ?
For simple to use and explore checkout
https://www.browsenodes.com
It also has option to browse the categories for other countries.
Example for India the URL is
https://www.browsenodes.com/amazon.in
You can get the categories for a market place api by requesting Browse tree report. Each browse node( Amazon way of storing categories ) contains a field child_nodes which gives you information about the sub categories.
http://docs.developer.amazonservices.com/en_IN/reports/Reports_ReportType.html#ReportTypeCategories__BrowseTreeReports
If you are looking for the categories of individual product. Please refer
http://docs.developer.amazonservices.com/en_IN/products/Products_GetProductCategoriesForSKU.html
http://docs.developer.amazonservices.com/en_IN/products/Products_GetProductCategoriesForASIN.html
The Browse Tree Guide is an Excel file available for download from the Amazon Seller Central. Once logged in, go to Seller Central Help > Manage Inventory > Reference > Browse Tree Guide
I tried in amazon mws scratchpad and could get category information. (scratchpad website: https://mws.amazonservices.com.au/scratchpad/index.html) .
The process of getting categories:
API section Reports -> RequestReport (report type:_GET_MERCHANT_LISTINGS_DATA_, report option: _GET_XML_BROWSE_TREE_DATA_)
GetReportList(in this list, you may find ReportId related with '_GET_XML_BROWSE_TREE_DATA_' )
GetReport(use this ReportId as input).
Then you can get the tree report for all categories
Amazon does not make it easy to get all the categories, but I think what you are looking for is actually in AWS Browse Nodes.
http://docs.aws.amazon.com/AWSECommerceService/latest/DG/BrowseNodes.html
Maybe it's a little late but i wanted to answer the question so some other ones
find useful. First, you need to make a request to RequestReport action, after that, you will make a request to GetRequest action using previous action's id, this will give you a long list of the categories (for the marketplaces you specified in the query). This is the link to the action & service, and also don't forget to take a look at ReportTypes enums, you must define them correctli.
POST /Reports/2009-01-01 HTTP/1.1
Content-Type: x-www-form-urlencoded
Host: mws.amazonservices.com
User-Agent: <Your User Agent Header>
AWSAccessKeyId=0PB842EXAMPLE7N4ZTR2
&Action=RequestReport
&EndDate=2008-06-26T18%3A12%3A21
&MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE
&Marketplace=ATVPDKIKX0DER
&ReportType=_GET_MERCHANT_LISTINGS_DATA_
&SellerId=A1XEXAMPLE5E6
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&StartDate=2009-01-03T18%3A12%3A21
&Timestamp=2009-02-04T18%3A12%3A21.687Z
&Version=2009-01-01
&Signature=ZQLpf8vEXAMPLE0iC265pf18n0%3D
► Option 1 :
Go To : https://sellercentral.amazon.com/gp/help/help.html/ref=au_1661_cont_help?ie=UTF8&itemID=1661&language=en_US
Log with your Amazon account ( even if you don't have seller user ).
Press on link : "Inventory File Templates and BTG" ( wait few seconds and it will download the file )
Print screen for Option 1
► Option 2 :
if you are looking for a CSV File that contains Amazon departments, categories, sub categories and their links ( based on : https://www.amazon.com/gp/site-directory ) , you may check also in this github repository : https://github.com/postme205/AmzCategoriesSubCategories/ or Here (github.io)