Using BIM 360 Field API (legacy) to get checklist location - autodesk-bim360

Title is a good summary.
The /api/get_checklists POST is deprecated and returns back empty data. So I use the GET /fieldapi/checklists/v1/ to get the list of checklist items, and then I used the id in the GET /fieldapi/checklists/v1/:id to get the 'complete details.' Unfortunately the JSON data does not include the location/area (I have verified this by querying the data, then changing the location, querying it again, and comparing the results). Looking for a way to get this information.
Side note: Not a fan of including the ticket in the URL param. The GET does support including the ticket in the body though... (not a very good RESTFUL design though).
Using postman to query the information.
Some sample outputs (I scrubbed most of the values):
{
"id": "",
"project_id": "",
"created_at": "",
"updated_at": "",
"created_by": "",
"status": "Open",
"company": {},
"description": "",
"source": [
{
"id": "",
"type": "Equipment"
}
],
"identifier": "",
"template": {
"id": "",
"name": ""
},
"checklist_type": "",
"name": "",
"priority": "",
"signatures": [],
"attachments": [],
"custom_field_values": [
{
"id": "",
"name": "",
"value": "",
"display_type": "",
"possible_values": [
"",
"",
"",
""
]
},
{
"id": "",
"name": "",
"value": "",
"display_type": "",
"possible_values": [
"",
"",
"",
"",
"",
"",
"",
"",
""
]
}
],
"comments": [],
"sections": [
]
}

our engineer team confirmed it is true the location isn’t included in fieldapi/checklists/v1:id. And the example in API document result doesn’t show it returns location. Sorry if this a bad news to you. I logged a wish CS-35616 to ask for exposing location with fieldapi/checklists/v1:id.
As to The /api/get_checklists POST is deprecated and returns back empty data. , you might need to specify ‘checklist_ids’ and ‘forced_checklist_ids’in the call. While by api/get_checklist_headers, get the ids ( completed_checklist_id) as the input.

Related

Shopify REST API: Unable to add a new product variant with new option type getting error "Option values provided for 1 unknown option(s)"

when creating a product in Shopify via the REST API, adds a default option and variant like below
"options": [
{
"id": 9651869188247,
"product_id": 7644173172887,
"name": "Title",
"position": 1,
"values": [
"Default Title"
]
}
]
Variants:
{
"variants": [
{
"id": 42211487744151,
"product_id": 7644173172887,
"title": "Default Title",
"price": "1.00",
"sku": "",
"position": 1,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Default Title",
"option2": null,
"option3": null,
"created_at": "2022-06-17T17:18:24+05:30",
"updated_at": "2022-06-17T17:18:24+05:30",
"taxable": true,
"barcode": null,
"grams": 0,
"image_id": null,
"weight": 0.0,
"weight_unit": "kg",
"inventory_item_id": 44310083534999,
"inventory_quantity": 0,
"old_inventory_quantity": 0,
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/42211487744151"
}
]
}
I want to update the existing Option and Variants of a product to show "Color" & "Size" as options and variants of them. For that I tried the Shopify Rest API but that still is raising the below error
request model:
{
"variant": {
"product_id": 7644173172887,
"option1": "red",
"option2": "small",
"price": "1.0",
"title": "S"
}
}
response :
{
"errors": {
"base": [
"Option values provided for 1 unknown option(s)"
]
}
}
You are not specifing what endpoint you're using but I can see that you're specifing the Product Id and that should not be the case. If you need to add a new variant this is the request you should do
POST https://yourstore.myshopify.com/admin/api/2022-04/products/7644173172887/variants.json
{"variant":{"option1":"Red", "option2" :"Small", "title": "Red", "price":"1.00"}}
You will also need to update the current "Default Title" variant (I suggest, if possible to create the product with a valid variant).
PUT https://yourstore.myshopify.com/admin/api/2022-04/variants/42211487744151.json
{"variant":{"id":42211487744151,"option1":"Red","option2" : "S", "price":"99.00", "title" : "Red"}}

How to request reload for TYPO3 extension field using mask

How do I request a reload for a TYPO3 extension field that is the trigger for a display condition of an other field in the mask.json.
"tx_mask_foobarfield": {
"config": {
"type": "select",
"renderType": "selectSingle",
"size": "",
"default": "foo",
"onChange" : "reload",
"items": [
[
"Foo",
"foo"
],
[
"Bar",
"bar"
]
],
"foreign_table": "",
"foreign_table_where": "",
"fileFolder": "",
"fileFolder_extList": "",
"fileFolder_recursions": "",
"maxitems": "",
"autoSizeMax": ""
},
"exclude": "0",
"key": "some_key"
},
I tried a couple of things but all references I could find tell me just about the way to do it in TCA.
I think you have the "onChange": "reload" on the wrong level.
From documentation it should be a direct successor of the fieldname (sibling to config)

How to change HERE maps type in SAP Visual Business GeoMap?

According to this Map Provider Configuration Changes, I use this configuration to add HERE maps in GeoMap:
var oMapConfig = {
"MapProvider": [{
"name": "HEREMAPS",
"type": "HERETerrainMap",
"description": "",
"tileX": "256",
"tileY": "256",
"maxLOD": "20",
"copyright": "Tiles Courtesy of HERE Maps",
"Source": [{
"id": "s1",
"url": "https://1.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/reduced.day/{LOD}/{X}/{Y}/256/png8?app_id=MY_ID&app_code=MY_CODE"
}, {
"id": "s2",
"url": "https://2.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/reduced.day/{LOD}/{X}/{Y}/256/png8?app_id=MY_ID&app_code=MY_CODE"
}
]
}],
"MapLayerStacks": [{
"name": "DEFAULT",
"MapLayer": {
"name": "layer1",
"refMapProvider": "HEREMAPS",
"opacity": "1.0",
"colBkgnd": "RGB(255,255,255)"
}
}]
};
this.oMap.setMapConfiguration(oMapConfig);
this.oMap.setRefMapLayerStack("DEFAULT");
But my map is in black and white style:
What I want is standard map:
In Configuring HERE (formerly Nokia, NAVTEQ) maps, new server URL is provided, I've tried this, but not working.
{
"id": "s1",
"url": http://1.maps.nlp.nokia.com/maptile/2.1/maptile/newest/normal.day/{LOD}/{X}/{Y}/256/png?app_id=YOUR_APP_ID&app_code=YOUR_APP_CODE"
}, {
"id": "s2",
"url": "http://2.maps.nlp.nokia.com/maptile/2.1/maptile/newest/normal.day/{LOD}/{X}/{Y}/256/png?app_id=MY_APP_ID&app_code=MY_APP_CODE"
}
And failed to find MapProvider configuration documentation in setMapConfiguration of GeoMap
Just change reduced.day to normal.day in your map URL, and you'll get colored map:)
edit:
Please refer to https://developer.here.com/documentation/map-tile/topics/examples.html for detailed APIs

A good example of using the Mapbox distance API

I am trying to use Mapbox to calculate the duration between two locations however the examples here are incomplete (at least with my limited experience). I would like to connect to this API using server-side Java, however I can't even get a basic example working in javaScript, Python or simply in the address bar in my browser.
I can get an example working in my browser using this url and substituting in my API key:
https://api.mapbox.com/geocoding/v5/mapbox.places/Chester.json?country=us&access_token=pk.my-token-value
However I can't get a similar example working with the distance API. The best I can manage is something like this:
https://api.mapbox.com/distances/v1/driving/[13.41894,52.50055],[14.10293,52.50055]&access_token=pk.my-token-value.
But I have no idea how to format my coordinates as I can't find a single example.
Has anyone been able to get this working. Ideally in Java, but client-side JavaScript or a valid url would be a great start.
I should also add that I can't get the JavaScript or Python ones working as they rely on external librarys that aren't referenced anywhere in the documentation!.
Thanks in advance.
Looks like you can provide a list of 2 or more semi-colon separated coordinates:
https://api.mapbox.com/optimized-trips/v1/mapbox/driving/13.41894,52.50055;14.10293,52.50055?access_token=pk.your_token
returns:
{
"code":"Ok",
"waypoints":[
{"distance":9.0352511932471,"name":"","location":[13.418991,52.500625],"waypoint_index":0,"trips_index":0},
{"distance":91.0575241567836,"name":"Berliner Chaussee","location":[14.103096,52.499738],"waypoint_index":1,"trips_index":0}
],
"trips":
[
{"geometry":"}_m_Iu{{pA}ZuQ}Iad#}cAk^jr#etOdE_iGtTqoAxBkoGnOkiCjR_s#wJ_v#b#}aN|aBogRyVucBiEw_C~r#_eB`Fc`NtP_bAshBorHa#}dCkOe~AmPmrGlPlrGjOd~A`#|dCrhBnrHuP~aAaFb`N_s#~dBhEv_CxVtcBkbBbeRo#l`NzJ`z#mRpr#qOpjCwBpnGoT~lAeEdkGsr#jtOtp#dQ~UjTtDfZf]jS",
"legs":[
{"summary":"","weight":4198.3,"duration":3426.4,"steps":[],"distance":49487},
{"summary":"","weight":7577.8,"duration":3501.3,"steps":[],"distance":49479.7}
],
"weight_name":"routability",
"weight":11776.1,
"duration":6927.700000000001,
"distance":98966.7}
]
}
I don't know if this is better now, but I had to work through it right now and can give you this example
curl "https://api.mapbox.com/directions-matrix/v1/mapbox/driving/9.51416,54.47004;13.5096410,50.0716190;6.8614070,48.5206360;14.1304840,51.0856060?sources=0&access_token={token}"`
This will return the following json for driving durations. I made use of the sources attribute, which is my search lng/lat and all other points are places in my database.
{
"code": "Ok",
"durations": [
[0.0, 29407.9, 34504.7, 24163.5]
],
"destinations": [{
"distance": 131.946157371,
"name": "",
"location": [9.514914, 54.468939]
}, {
"distance": 34.636975593,
"name": "",
"location": [13.509868, 50.071344]
}, {
"distance": 295.206928933,
"name": "",
"location": [6.863566, 48.52287]
}, {
"distance": 1186.975749670,
"name": "",
"location": [14.115694, 51.080408]
}],
"sources": [{
"distance": 131.946157371,
"name": "",
"location": [9.514914, 54.468939]
}]
}
Adding the annotations=distance parameter to the url will return the distances instead of the durations if you need that.
{
"code": "Ok",
"distances": [
[0.0, 738127.3, 902547.6, 616060.8] // distances in meters
],
"destinations": [{ // destinations including the source
"distance": 131.946157371, // result 0
"name": "",
"location": [9.514914, 54.468939]
}, {
"distance": 34.636975593, // result 1
"name": "",
"location": [13.509868, 50.071344]
}, {
"distance": 295.206928933, // result 2
"name": "",
"location": [6.863566, 48.52287]
}, {
"distance": 1186.975749670, // result 3
"name": "",
"location": [14.115694, 51.080408]
}],
"sources": [{ // source where we start from
"distance": 131.946157371,
"name": "",
"location": [9.514914, 54.468939]
}]
}

Jasper Report with RestAPI

I have a report on JasperServer(5.6) which accepts few parameters. I edit few settings on the Output Options tab and enter emails which i would like to sent to on Notifications tab. The report gets generated successfully and an email is sent out perfectly.
I wish to use the Rest API of JasperServer to pass on my input options and to schedule and email the report. I went through there documentation http://community.jaspersoft.com/documentation/jasperreports-server-web-services-guide/v56/rest-v2-report-services but couldn't understand how to use the rest api.
Here is the properties of my report on the jasper server
Can someone help me out how to schedule my report.
Maybe it's can help you: jasperserver rest java client.
This is a REST client for Jasperserver.
I guess, i have figured out the way to schedule a job on jasper server. Details can be found here
http://community.jaspersoft.com/documentation/tibco-jasperreports-server-web-services-guide/v62/scheduling-report
But as an example here it is (call it with PUT method)
http://localhost:8080/jasperserver/rest_v2/jobs
and in the body define the job structure
{
"id": 3819,
"version": 2,
"username": "jasperadmin",
"label": "publisher_123_report",
"description": "",
"creationDate": "2015-12-30T02:02:40.382+03:00",
"trigger": {
"simpleTrigger": {
"id": "1770",
"misfireInstruction": "0",
"startDate": "2015-12-20T00:00:00+11:00",
"startType": "2",
"timezone": "Australia/Victoria",
"version": "0",
"occurrenceCount": "1"
}
},
"source": {
"reportUnitURI": "/Reports/Prod/test_automated_report_v14",
"parameters": {
"parameterValues": {
"PublisherId" : "20",
"MonthEnd" : "2015-02-01",
"MonthStart" : "2015-03-20",
"email" : "admin#admin.com",
"CountryCode" : "560"
}
}
},
"baseOutputFilename": "publisher_124_automated_report",
"outputLocale": "",
"mailNotification": {
"subject": "publisher monthly report" ,
"toAddresses": {
"address": ["address1To#add.com", "address2To#add.com"]
},
"ccAddresses": {
"address": ["address1cc#add.com", "address2cc#add.com"]
},
"bccAddresses": {
"address": ["address1bcc#add.com", "address2bcc#add.com"]
},
"includingStackTraceWhenJobFails" : false,
"resultSendType" : "SEND_EMBED",
"skipEmptyReports" : true,
"skipNotificationWhenJobFails" : false
},
"alert": {
"id": 0,
"version": -1,
"recipient": "OWNER_AND_ADMIN",
"toAddresses": {
"address": ["address1#add.com", "address2#add.com"]
},
"jobState": "FAIL_ONLY",
"messageText": "Success",
"messageTextWhenJobFails": "Failure",
"subject": "Notification Subject",
"includingStackTrace": true,
"includingReportJobInfo": true,
"jobState" : "ALL"
},
"outputTimeZone": "Australia/Melbourne",
"repositoryDestination": {
"id": 3817,
"version": 0,
"folderURI": "/Reports/Prod",
"sequentialFilenames": false,
"overwriteFiles": false,
"outputDescription": "",
"timestampPattern": null,
"saveToRepository": true,
"defaultReportOutputFolderURI": null,
"usingDefaultReportOutputFolderURI": false,
"outputLocalFolder": null,
"outputFTPInfo": {
"userName": null,
"password": null,
"folderPath": null,
"serverName": null
}
},
"outputFormats": {
"outputFormat": ["HTML"]
}
}
More options can be supplied while the creating job.