Is there an example of reading the object tree and associated dbIds (typically found in the Autodesk viewer) from the Model Derivative API?
First call that endpoint to get the guid of the view:
https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET
Then call that second endpoint passing in the guid obtained in the first call:
https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-GET
Take a look at the links for example payload of the responses. Using the Forge SDKs those endpoints are called respectively getMetadata and getModelviewMetadata.
Related
In my ASP.NET Core Web Api, I'm trying to call Graph API to retrieve the data of other users in the organization. I'm using the On Behalf Of flow. The bootstrap token is passed in from SPA client code.
In the Startup code, I have:
builder.Services
.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(builder.Configuration)
.EnableTokenAcquisitionToCallDownstreamApi()
.AddMicrosoftGraph("https://graph.microsoft.com/beta", "user.read user.readbasic.all profile")
.AddInMemoryTokenCaches();
In the Controller's Action, I have:
_graphServiceClient.Users.Request()
.Filter($"mail eq 'someuser#myorg.com'")
.Select((user) => new {
DisplayName = user.DisplayName,
City = user.City,
Country = user.Country,
BusinessPhones = user.BusinessPhones
})
.Request()
.GetAsync();
However, at runtime, I only get the DisplayName value. I don't get the values of City, Country or BusinessPhones. They are al null.
When I tried the same query in Graph Explorer, I saw the values for all of them.
What am I missing?
First, your code snippet has an error that you wrote 2 .Request(), you should remove one.
Whatever flow you used are all generating an access token so that you can access the api, therefore when you got correct data from the api, that means you have a right setting in using the flow, so I think if there's any issue, it should locate at the part of calling api. Then I did some test in my side.
Could you pls check if you call the api directly, you can get the value of City, Country and BUsinessPhones these 3 properties? Per my test, when I call the api, I can get response like screenshot below and by default it's null
https://graph.microsoft.com/beta/users?$filter=mail eq
'tinywang#xxx.onmicrosoft.com'&$select=mail,city,country,DisplayName,BusinessPhones,userType,usageLocation
And when I followed this tutorial to call the api via sdk, I got the same result:
My idea is checking the response of calling the api first and if we can't find the issue, then could you pls provide the tutorial you followed to help reproduce the issue.
I have 4 places - origin, destination and 2 waypoints. I am trying to make Google Directions API call to get the most optimal route through those two waypoints. The problem is that Google API doesn't reorder my waypoints according to the optimal route, but it creates a route including the waypoints in the initial order that I defined in the call.
The wanted route is as following:
Origin
Waypoint 2
Waypoint 1
Destination
Received route output is as following:
Origin
Waypoint 1
Waypoint 2
Destination
Here is the API call I tried:
https://maps.googleapis.com/maps/api/directions/json?origin=46.3526877,16.8123505&destination=46.3091764,16.3420242&waypoints=optimize:true%7Cvia:46.3380636%2C16.6129778%7Cvia:46.3258985%2C16.7827804&alternatives=true&key=GOOGLE_API_KEY
I tried adding "optimizeWaypoints" parameter but I always get an empty "waypoint_order" array (which should contain waypoints in the correct order so that the route will be optimal according to the documentation).
Here is the API call with "optimizeWaypoints" parameter added:
https://maps.googleapis.com/maps/api/directions/json?origin=46.3526877,16.8123505&destination=46.3091764,16.3420242&waypoints=via:46.3380636%2C16.6129778%7Cvia:46.3258985%2C16.7827804&alternatives=true&optimizeWaypoints=true&key=GOOGLE_API_KEY
Can someone please point me in the right direction?
Thanks!
Try setting stopover to true for your waypoints. This is what I had to do to.
Link to Google API
Google maps does not automatically optimize routes for multiple destinations. You got to use Google distance matrix api or something similar. Try this: https://d3o9xul5a19dde.cloudfront.net
There is an API as well, in addition to web interface.
If for example an Asset contains Relationships property for owner then when using GetSingle API (from a client App) we get back something like: "owner":"resource:somenamespace.owner#owner01". (i.e. related participant is owner with ownerId = owner01).
What is actually being returned for the relationship property?
Is there anyway we can actually get back all the properties of the related instance (owner with ownerId = owner01) in the same call? I have tried adding parameter to the Rest call such as below but no joy.?resolve=true&include=true.
If I can't get related instance properties in same Rest call then how do I extract out the related Id (e.g. owner01 in above example) from the returned "owner":"resource:somenamespace.owner#owner01"I can then do a separate GetSingle call to the owner Rest end point using the extracted ownerId?I have tried searching the web for docs on such Rest API parameters/processing of results but no joy.Many thanks.Lalji
1) What's returned is a URI resource ID for the related object (ie owner)
2) Yes. Use Loopback filters to resolve. For example ('GET' call - eg. using httpClient or axios etc eg - two examples:
GET 'http://localhost:3000/api/CommodityAsset?filter={"where":{"assetId":"A01"},"include":"resolve"}' // narrow filter - for one asset
GET 'http://localhost:3000/api/CommodityAsset?filter={"where":{"ownerId":"resource:org.acme.biznet.owner%23T01"},"include":"resolve"}' // broader, assets owned by a particular owner, could be many
where %23 is '#' the encoded character used in Composer language relationship notation.
I use Google Places Photos Api and I want to get sights images for selected city by placeid or city title.
I try 2 methods:
1. f.e. I send request (used London placeid)
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJdd4hrwug2EcRmSrV3Vo6llI&key=API_KEY
get location from response
"lat": 51.5073509
"lng": -0.1277583
next step is request to
https://maps.googleapis.com/maps/api/place/radarsearch/json?location=51.5073509,-0.1277583&radius=5000&types=park|church|cafe|food|bar|night_club|stadium|store&keyword=&key=API_KEY
response contain many objects with placeid, that i use for new request like first
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJ1eu1vwgIdkgRwjsifpZERQc&key=API_KEY
response contain photo_reference object which is the part of my image source
https://maps.googleapis.com/maps/api/place/photo?photoreference=CoQBcwAAAMLCk4X_WMliqIfISe-mgxRadycuzApodVcaCrTMGP6wQXJaquATedXMkvnjuLAfTG9xzBYQfSNm3iXV07wxHr_X_WDhfjz_yQjmqCYlKwYwK5hH-nl9qi-4ZZqKKtFuphFEY8ka25GYN2sTNMdd0v99j7YCzpR-lHJnl0zA9QoPEhBA5CnCgElBAU7Z92VTShg2GhQUes4fTRKiJlW6rYKYEaNilauWaA&key=API_KEY&maxwidth=1200
result image
It's not the best photo of London...
2.
Using textsearch with param query=sights+in+London
https://maps.googleapis.com/maps/api/place/textsearch/json?query=sights+in+London&key=API_KEY
This request return response which are contains photo_reference objects.
finally request is
https://maps.googleapis.com/maps/api/place/photo?photoreference=CnRnAAAAlLsg47UJRPVLdM8_sUbeLSia70EJ_mTisVDfCDTVUYNXl-35BGqzRARtq-Lt1CNcBWy3sKigfBVuF0iCr9-xqp1khK2l5JV3806LKvZrHJCaONYW35UBxxIIwxvxV-df4I4hg6f_zgeeIkWXGSYQhhIQNGYJl0fvHb3HslymbhH1thoUdLhGe8rJVCnyl_y0xAagzkFWs-Y&key=API_KEY&maxwidth=1200
result image
How can i get images like these
The Places API directly returns some photos for cities like London now. For example your query for London by Place ID:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJdd4hrwug2EcRmSrV3Vo6llI&key=API_KEY
Includes this photo of the Place of Westminster that is also shown on Google Maps.
It looks like you'd be looking for an API that surfaces Google Image Search results, and there is one: Google Custom Search
https://developers.google.com/custom-search/docs/overview
I'm not familiar with it, but there's already an answer for how to get just images out of your requests to this API:
Google custom search for images only
When I call communityService.getMyCommunities(params) or communityService.getPublicCommunities(params) or communityService.getSubCommunities(parentCommunity, params) I would expect that filling params with e. g. tags=[mytag,yourtag] the call would only lookup communities having at least one of these tags (or both, however).
But to me it looks like this param ("tags") is simply ignored, and I always receive all communities of the given category (my / public / sub).
In case of having lots of communities of the requested category this massively slows down performance when I only want to retrieve communities with e. g. one certain tag: I receive all data over the net and must filter / lookup the received object list locally.
What am I doing wrong?
Is there something missing in the SDK implementation?
As part of the communities/my api, you cannot do any filtering... you need to use Search APIs.
In order to get a filtered list of communities based on the tags, you need to make a request to the following URL.
https://apps.na.collabserv.com/search/atom/mysearch?scope=personalOnly&scope=communities&query=&constraint={%22type%22%3A%22category%22%2C%22values%22%3A[%22Tag%2Fprb%22]}&page=1&pageSize=10
Yes, it is URL encoded, you can then change prb to match your tag, and you can repeat the constraints for each tag
You can also reference Link to Search API Constraints