Set Location in BIM360 Quality issue via API? (Rather than Location Details) - autodesk-forge

I am able to add Quality Issues through the BIM360 API (or associated APIs, link below) and I am able to set the Location Details. However, my customer uses the Location field, not Location Details. Is there any way to set the Location, specifically?
Here is the page for posting an item:
https://forge.autodesk.com/en/docs/bim360/v1/reference/http/field-issues-POST/
I don't see a location attribute or a location permitted attribute, just location details.
See image: https://i.stack.imgur.com/3OmZd.png

We can get the location id under the path attributes.lbs_location
{
"id": "038edfcf-t56y-4e04-a358-42c95f20c945",
"type": "quality_issues",
//...
"attributes": {
//...
"lbs_location": "d14ce3a6-e61b-4ab0-a9be-5acf7b5366df",
//...
},
// ...
}
To get corresponding location data, we need to call GET v2/containers/{containerId}/trees/{treeId}/nodes
{
"pagination": {
"limit": 2,
"offset": 0,
"totalResults": 2,
"nextUrl": null
},
"results": [
{
"id": "5add4375-f223-4201-88b9-8049e68416aa",
"parentId": null,
"type": "Root",
"name": "Project",
"description": "Project description",
"barcode": null,
"order": 0,
"documentCount": 0,
"areaDefined": false
},
{
"id": "d14ce3a6-e61b-4ab0-a9be-5acf7b5366df",
"parentId": "5add4375-f223-4201-88b9-8049e68416aa",
"type": "Area",
"name": "Area 1",
"description": "An Area 1 node",
"barcode": "ABC123",
"order": 0,
"documentCount": 2,
"areaDefined": true
}
]
}
To modify the location id for a quality issue, we can call PATCH issues/:id with the below payload:
{
"data": {
"type": "quality_issues",
"id": "038edfcf-t56y-4e04-a358-42c95f20c945",
"attributes": {
"lbs_location": "d14ce3a6-e61b-4ab0-a9be-5acf7b5366df"
}
}
}

Related

linkdin api v2 - how to get like comment count in posts/shares list

i'm fetching all posts of a user urn from LinkedIn shares/posts API.
https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/posts-api?view=li-lms-2023-01&tabs=http#find-posts-by-
https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api?view=li-lms-unversioned&tabs=http
in response i'm getting array of this object. How can I fetch want like and comment count in this object list.
{
"owner": "urn:li:organization:31060",
"activity": "urn:li:activity:702717776",
"edited": false,
"created": {
"actor": "urn:li:person:uMD-5FNQoE",
"time": 1675400404262
},
"distribution": {
"linkedInDistributionTarget": {
"visibleToGuest": true
}
},
"content": {
"shareMediaCategory": "RICH"
},
"clientApp": "urn:li:developerApplication:3710791",
"text": {
"annotations": [],
"text": "A lot of our clients "
},
"id": "70271386165857",
"lastModified": {
"actor": "urn:li:csUser:0",
"time": 1675400404332
}
},

Autodesk Forge GET hubs returns hubs I don't have / currently use

I’m reading through the tutorial (https://forge.autodesk.com/en/docs/data/v2/tutorials/publish-model/) to automatically publish projects, and having troubles when using GET hubs –
I’m currently using postman, and set up a 3 legged auth token with data:read, data:write, and data:create using the example here - https://forge.autodesk.com/blog/3-legged-authentication-postman
I get the correct response back using GET users/#me (see below). So I think that the authentication is working properly.
"userId": "**OBSCURED**",
"userName": "shane#**OBSCURED**",
"emailId": "shane#**OBSCURED**",
"firstName": "Shane",
"lastName": "**OBSCURED**",
"emailVerified": true,
"2FaEnabled": false,
"countryCode": "US",
"language": "en",
"optin": false,
"lastModified": "2020-09-08T19:31:48.802",
"profileImages": {
"sizeX20": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x20.jpg?r=**OBSCURED**",
"sizeX40": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x40.jpg?r=**OBSCURED**",
"sizeX50": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x50.jpg?r=**OBSCURED**",
"sizeX58": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x58.jpg?r=**OBSCURED**",
"sizeX80": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x80.jpg?r=**OBSCURED**",
"sizeX120": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x120.jpg?r=**OBSCURED**",
"sizeX160": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x160.jpg?r=**OBSCURED**",
"sizeX176": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x176.jpg?r=**OBSCURED**",
"sizeX240": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x240.jpg?r=**OBSCURED**",
"sizeX360": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x360.jpg?r=**OBSCURED**"
},
"ldapInfo": {
"ldapEnabled": false
},
"socialUserInfoList": []
}
When I try with the same token to get hubs (using the developer docs here https://forge.autodesk.com/en/docs/data/v2/reference/http/hubs-GET/) I get the response shown below. I expect to see the accounts listed in my docs.bim360.autodesk.com projects as shown in the screenshot below. I read online that sometimes provisioning needs to be done by Autodesk to get the right stuff to show up – it seems these are hubs that I’m no longer using and set up in the early days of our bim360 account (I believe these hubs are reflective of our very first b360 project, and a test project I set up).
I’ve also tried to get projects with the hub id’s listed below, but get 404 errors saying that they do not exist.
I am also not sure if the warnings at the end of the response are the two hubs I’m looking for, because I’m writing my request wrong, or something else. I get a 200 OK back, but it seems like what I’m looking for is missing.
{
"jsonapi": {
"version": "1.0"
},
"links": {
"self": {
"href": "https://developer.api.autodesk.com/project/v1/hubs"
}
},
"data": [
{
"type": "hubs",
"id": "a.YnV**OBSCURED**NjU",
"attributes": {
"name": "**OBSCURED**",
"extension": {
"type": "hubs:autodesk.core:Hub",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/hubs:autodesk.core:Hub-1.0"
},
"data": {}
},
"region": "US"
},
"links": {
"self": {
"href": "https://developer.api.autodesk.com/project/v1/hubs/a.YnVz**OBSCURED**uNjU"
}
},
"relationships": {
"projects": {
"links": {
"related": {
"href": "https://developer.api.autodesk.com/project/v1/hubs/a.YnVza**OBSCURED**uNjU/projects"
}
}
}
}
},
{
"type": "hubs",
"id": "a.YnVz**OBSCURED**ltNQ",
"attributes": {
"name": "shane",
"extension": {
"type": "hubs:autodesk.core:Hub",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/hubs:autodesk.core:Hub-1.0"
},
"data": {}
},
"region": "US"
},
"links": {
"self": {
"href": "https://developer.api.autodesk.com/project/v1/hubs/a.YnVz**OBSCURED**tNQ"
}
},
"relationships": {
"projects": {
"links": {
"related": {
"href": "https://developer.api.autodesk.com/project/v1/hubs/a.YnVz**OBSCURED**ltNQ/projects"
}
}
}
}
}
],
"meta": {
"warnings": [
{
"Id": null,
"HttpStatusCode": "403",
"ErrorCode": "BIM360DM_ERROR",
"Title": "Unable to get hubs from BIM360DM US.",
"Detail": "You don't have permission to access this API",
"AboutLink": null,
"Source": [],
"meta": []
},
{
"Id": null,
"HttpStatusCode": "403",
"ErrorCode": "BIM360DM_ERROR",
"Title": "Unable to get hubs from BIM360DM EMEA.",
"Detail": "You don't have permission to access this API",
"AboutLink": null,
"Source": [],
"meta": []
}
]
}
}
Here's what I see in my docs.b360.autodesk.com portal
Am I understanding this right, that hubs are “accounts” in the above screenshot? And projects would be projects listed in those accounts/hubs?
In order to see your BIM360 accounts listed among the hubs, you do have to provision the access for every single Forge app.
And yes, the BIM360 "accounts" would show up as individual "hubs" (starting with b.) in the response of the GET hubs call.

CreateObject Network Components

have been referring to the createObject API and as part of my request to order a virtual machine, I would like to configure the machine with both a public and a private interface. Here are the relevant parts of the JSON which works -
{
"parameters":[{
"hostname": "hostname-test",
"domain": "domain-test",
"startCpus": 8,
"maxMemory": 16384,
"hourlyBillingFlag": true,
"operatingSystemReferenceCode": "ubuntu_14_64",
"localDiskFlag": true,
"privateNetworkOnlyFlag": false,
"networkComponents": [
{
"maxSpeed": 1000
}
]
}]
}
However I would like to also set a limited public bandwidth, similar to the options presented on the web interface. Reading the network component structure as well as the above referenced create object call, am unable to decipher the fields for choosing a specific bandwidth.
I also find no mention of the bandwidth options in getCreateObjectOptions. Any help would be great.
all the available options for the createObject method are displayed using this method:
https://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/getCreateObjectOptions
In regards with the network configuration the method above will return values like this:
"networkComponents": [
{
"itemPrice": {
"hourlyRecurringFee": "0",
"recurringFee": "0",
"item": {
"description": "10 Mbps Public & Private Network Uplinks"
}
},
"template": {
"id": null,
"networkComponents": [
{
"maxSpeed": 10
}
],
"privateNetworkOnlyFlag": false
}
}
In the JSON above you can see the item "10 Mbps Public & Private Network Uplinks" if you want to configure that item in your order you need to follow the "template" configuration in this case it says that you need to add the follow configuration:
"networkComponents": [
{
"maxSpeed": 10
}
],
"privateNetworkOnlyFlag": false
That's it, however the createObject method has a drawback you only can configure the options displayed by the method getCreateObjectOptions, but the portal offers many other options which are not available using the createObject method. In case you need advanced options at the moment to order you need to use the placeOrder method this article could help you to undertand the placeOrder method:
https://sldn.softlayer.com/blog/bpotter/going-further-softlayer-api-python-client-part-3
Regards
Adding this here for posterity.
Here is a JSON template which can be used as a basis to build other configurations :
{
"parameters": [{
"imageTemplateId": null,
"location": "449500",
"packageId": 46,
"prices": [{
"hourlyRecurringFee": ".131",
"id": 30823,
"recurringFee": "87",
"item": {
"description": "8 x 2.0 GHz Cores"
}
}, {
"hourlyRecurringFee": ".153",
"id": 29663,
"recurringFee": "101.5",
"item": {
"description": "16 GB "
}
}, {
"hourlyRecurringFee": "0",
"id": 37204,
"recurringFee": "0",
"item": {
"description": "Ubuntu Linux 14.04 LTS Trusty Tahr - Minimal Install (64 bit)"
}
}, {
"hourlyRecurringFee": ".004",
"id": 26466,
"recurringFee": "2.9",
"item": {
"description": "100 GB (LOCAL)"
}
}, {
"hourlyRecurringFee": "0",
"id": 23070,
"recurringFee": "0",
"item": {
"description": "Reboot / Remote Console"
}
}, {
"hourlyRecurringFee": ".014",
"id": 23777,
"recurringFee": "5",
"item": {
"description": "1 Gbps Private Network Uplink"
}
}, {
"hourlyRecurringFee": "0",
"id": 34183,
"item": {
"description": "0 GB Bandwidth"
}
}, {
"hourlyRecurringFee": "0",
"id": 34807,
"recurringFee": "0",
"item": {
"description": "1 IP Address"
}
}, {
"hourlyRecurringFee": "0",
"id": 27023,
"recurringFee": "0",
"item": {
"description": "Host Ping"
}
}, {
"hourlyRecurringFee": "0",
"id": 32500,
"recurringFee": "0",
"item": {
"description": "Email and Ticket"
}
}, {
"hourlyRecurringFee": "0",
"id": 32627,
"recurringFee": "0",
"item": {
"description": "Automated Notification"
}
}, {
"hourlyRecurringFee": "0",
"id": 33483,
"recurringFee": "0",
"item": {
"description": "Unlimited SSL VPN Users & 1 PPTP VPN User per account"
}
}, {
"hourlyRecurringFee": "0",
"id": 35310,
"recurringFee": "0",
"item": {
"description": "Nessus Vulnerability Assessment & Reporting"
}
}],
"quantity": 1,
"sourceVirtualGuestId": null,
"sshKeys": [{
"sshKeyIds": [
12345
]
}],
"useHourlyPricing": true,
"virtualGuests": [{
"domain": "domain.test",
"hostname": "hostname.test"
}],
"complexType": "SoftLayer_Container_Product_Order_Virtual_Guest"
}]
}
Required ID's:
package id - obtained from SoftLayer_Product_Package->getAllObjects - it is the field "id"
price id - obtained from SoftLayer_Product_Package->getItemPrices - once again it is the field id (note there are several places where the same field name is used). This lists all the possible configurations that can go into a virtual machine. The above JSON selects a few of the options.
Finally with the JSON template, the order can be verified and placed.
(PS: Have tested this only with a virtual machine order. The SSH Key ID is an example and should be replaced with a valid ID.)

Get all users/groups having access to a collaboration : BOX API

Is there a way to retrive all the users/groups having access to a collaboration : BOX API?
The API defines a collaboration as an access control list. It's an object that grants a single user (or group) permissions to access a folder, so you can't really have access to a collaboration.
It sounds more like you're asking how you can get a list of all the collaborations on a folder, which you can do with:
GET /folders/{id}/collaborations
which will return something like:
{
"total_count": 1,
"entries": [
{
"type": "collaboration",
"id": "14176246",
"created_by": {
"type": "user",
"id": "4276790",
"name": "David Lee",
"login": "david#box.com"
},
"created_at": "2011-11-29T12:56:35-08:00",
"modified_at": "2012-09-11T15:12:32-07:00",
"expires_at": null,
"status": "accepted",
"accessible_by": {
"type": "user",
"id": "755492",
"name": "Simon Tan",
"login": "simon#box.net"
},
"role": "editor",
"acknowledged_at": "2011-11-29T12:59:40-08:00",
"item": null
}
]
}
https://developers.box.com/docs/#folders-view-a-folders-collaborations

Ordering of get folder items API call

I am using the get folder items API call, and I can tell from my tests that the order appears to be folders first and then alphabetical.
Is this call guaranteed to always return items in that order?
Box Platform team member here ... we do not consider the order of the results returned by any of our collections endpoints part of their public contract and they are subject to change. For GET /folders/id/items at least, the JSON response includes an order array, which shows how the response is ordered.
{
"total_count": 6,
"entries": [
{
"type": "folder",
"id": "192429928",
"sequence_id": "1",
"etag": "1",
"name": "Lebron and Friends"
},
{
"type": "folder",
"id": "192429929",
"sequence_id": "1",
"etag": "1",
"name": "Stephen Curry Three Pointers"
},
{
"type": "file",
"id": "818853864",
"sequence_id": "0",
"etag": "0",
"name": "Heat.jpg"
},
{
"type": "file",
"id": "818853862",
"sequence_id": "0",
"etag": "0",
"name": "Warriors.jpg"
}
],
"offset": 0,
"limit": 4,
"order": [
{
"by": "type",
"direction": "ASC"
},
{
"by": "name",
"direction": "ASC"
}
]
}
Note that this response can also include web links.
If your app depends on the list of items being ordered a certain way, we recommend sorting on the client.