No model issue for IFC Models in the Viewer - autodesk-forge

Need help on the similar topic posted below:
Autodesk Forge Viewer gives empty model (no geometry) issue on IFC file that works in BIM360
As suggested in the article, I have added the required options for the translation, and the model creates the correct derivatives. But , still the Viewer shows the same error of "model is empty. there is no geometry for the viewer to show" Please suggest, if the Viewer also needs to be handled differently to load these "modern" conversion-based files. Thanks very much.

Thank you for your reproducible model. The translation result looks fine while using the modern conversion method. I replied to you via Forge Help. It contains a snapshot of my test.
So, could you have a try? This is the code example of how I send the translation request using the modern conversion method.
Note. if you want to override an existing translation result, please be sure to set the header parameter x-ads-force: true.
curl --location --request POST 'https://developer.api.autodesk.com/modelderivative/v2/designdata/job' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--header 'x-ads-force: true' \
--data '{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bXlidWNrZXQvSUZDX0JydWVja2VfS2xpbmdlbmJlcmdfNC56aXA"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"3d"
],
"advanced": {
"conversionMethod": "modern"
}
}
]
}
}'
ref: https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/#headers

Related

copy contents from sample json file to index elastic aearch index json file

elastic search version i am using 6.6.1
i have created index by running following command
curl -XPUT http://localhost:9200/incident_422? -H 'Content-Type: application/json' -d #elasticsearch.json
i need to update the index file with sample json data.(sample.json)
{
"properties": {
"id185": {
"type": "byte"
},
"id255": {
"type": "text"
},
"id388": {
"type": "text"
}
}
}
I tried running the command
curl -XPUT http://localhost:9200/incident_422/mapping/_doc? -H 'Content-Type: application/json' -d #sample.json
but i get the error message saying that
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Rejecting mapping update to [incident_422] as the final mapping would have more than 1 type: [mapping, doc]"}]
i have read somewhere that ELK 6 doesnt support more than two types.
Could anyone please tell me how this can be achieved without downgrading the version
This seems to related to the removal of mapping type, you need to specify the type name while indexing the documents.
try adding type to your index request aka http://localhost:9200/incident_422/<your-type-name> in your URL and it should solve the issue.

Google Drive API: List all folders under shared drive

Question on listing the folders under shared drive.
I was able to get successful response while calling the API below by passing query parameters as:
includeTeamDriveItems=true
q=‘0AATe_aghhsdfvbdfg’ in parents and mimeType = ‘application/vnd.google-apps.folder’
supportsAllDrives=true
API: https://developers.google.com/drive/api/v3/reference/files/list?apix_params=%7B%22includeTeamDriveItems%22%3Atrue%2C%22q%22%3A%22%270AATe_aghhsdfvbdfg%27%20in%20parents%20and%20mimeType%20%3D%20%27application%2Fvnd.google-apps.folder%27%22%2C%22supportsAllDrives%22%3Atrue%7D
Successful Response:
{
"kind": "drive#fileList",
"incompleteSearch": false,
"files": [
{
"kind": "drive#file",
"id": "1E-c0rNCQMlQvXNUGTKSWdPHBOwwzjtcf",
"name": "Integration",
"mimeType": "application/vnd.google-apps.folder",
"teamDriveId": "0AATe_aghhsdfvbdfg",
"driveId": "0AATe_aghhsdfvbdfg"
},
{
"kind": "drive#file",
"id": "1QOMRSPuE1msJJmyr3yJOMZsBrn3nrtAx",
"name": "Folder1",
"mimeType": "application/vnd.google-apps.folder",
"teamDriveId": "0AATe_aghhsdfvbdfg",
"driveId": "0AATe_aghhsdfvbdfg"
}
]
}
Question: From the response, it returns existing folders under the shared drive. Is it possible to also get all the sub folders under parent folders at once instead of having to pass parent folder ID under query parameters each time ? (e.g: To get all the sub folders under parent folder ‘Integration’)
Dilip
The folders just under the parent folder can be retrieved by the search query with one API call like below. In this case, 'folderId' in parents is used as the search query.
curl \
'https://www.googleapis.com/drive/v3/files?corpora=drive&driveId=driveId&includeItemsFromAllDrives=true&q=%27folderId%27%20in%20parents&supportsAllDrives=true' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
And, when you want to retrieve the files under 2 folders, you can also use the following sample. In this case, 'folderIdA' in parents or 'folderIdB' in parents is used as the search query.
curl \
'https://www.googleapis.com/drive/v3/files?corpora=drive&driveId=driveId&includeItemsFromAllDrives=true&q=%27folderIdA%27%20in%20parents%20or%20%27folderIdB%27%20in%20parents&supportsAllDrives=true' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
From your question, I think that you have already been done above.
In the current stage, all nested subfolders under the parent folder cannot be directly retrieved.
In this case, it is required to prepare a script.
I think that this thread will be useful.
Unfortunately, in the current stage, it seems that this is the current specification at Google side.
Note:
In the most cases, includeItemsFromAllDrives=true and supportsAllDrives=true can be used. But I had the some cases that corpora=drive and driveId=### are also required. So when in your shared Drive, the files cannot be retrieved, please try to use this.
References:
Files: list
Search for files and folders

Complex object multpart json

I want to build a request in insomnia to upload person, documents and it's files
How can I put a multipart file inside a JSON object? I don't want to deal with string base64 because it's too big and too slow to travel over the network.
I have a rest api made with spring boot and kotlin that will receive this JSON file.
Here's some code for what I want to achieve:
curl --request POST \
--url http://localhost:8080/ \
--header 'content-type: multipart/form-data; boundary=--
-011000010111000001101001' \
--form 'person={
"first_name": "Foo",
"last_name": "Fighters"
}' \
--form 'document=[
{
"document_name": "test1",
"document_description":"test1",
"document_file": "multipart file1"
},
{
"document_name": "test2",
"document_description":"test2",
"document_file": "multipart file2"
},
{
"document_name": "testN",
"document_description":"testN",
"document_file": "multipart fileN"
}
]'
Where the key document_file value stands for the file itself, not a String.
Some pictures to make it clear:
Here is the overview of the multipart
Person detail:
Document detail:
I need to know what files are from what documents, and I can have 0 or many documents related to the person.
Therefore, that's why adding 1 file for each document I want to create won't work. It needs to be inside the object(just like presented in the images) that way I know that file-X is from document-X and vice-versa.
Thanks in advance!

ampUrls batchGet JSON format

I do not understand the documentation for the JSON package defining the URLs. I am using curl. I am able to pass my key to the API. I am having trouble with the url data. Below is what I have tried without success. Any help would be appreciated.
enter code here
--data '{
"lookupStrategy": "FETCH_LIVE_DOC",
"urls": [
"originalURL":"https://www.myurl.com/index.html", \
"ampURL":"https://www.myurl.com/index.html", \
"cdnAmpUrl":"https://www-myurl-com.cdn.ampproject.org/c/s/index.html"
]
}'
Your JSON should be:
{
"lookupStrategy": "FETCH_LIVE_DOC",
"urls": [
"https://www.myurl.com/index.html",
"https://www.myurl.com/index.html",
"https://www-myurl-com.cdn.ampproject.org/c/s/index.html"
]
}
Looks like you are using the return data schema.

Shopify fulfillment

The online shopify docs for fulfillment show this example:
POST /admin/orders/#{id}/fulfillments.json
{
"fulfillment": {
"tracking_number": null,
"line_items": [
{
"id": 466157049
}
]
}
}
The docs also say that not specifying an item id will cause all items to fulfill.
My postdata to that api endpoint reads:
{"fulfillment":{"tracking_number":null}}
This comes back:
{"errors":{"fulfillment":"can't be blank"}}
I have tried this:
{"fulfillment":{"tracking_number":null,"line_items":[{"id":300668234}]}}
which is a valid item id for my order. The same message comes back.
Ideas?
Are you setting your Content-Type to application/json?
Trying sending the same request using cURL
curl -X POST -H 'Content-Type: application/json' -d #fulfillment.json https://API_KEY:API_TOKEN#SHOP.myshopify.com/admin/orders/ORDER_ID/fulfillments.json
If that works, it means you aren't sending your request correctly.
curl -H "Content-Type: application/json" -X POST -d '{"fulfillment": {"tracking_number": "123456789","notify_customer": true}}' https://API_KEY:TOKEN#SHOP.myshopify.com/admin/orders/ORDER_ID/fulfillments.json
This is the working example of updating tracking number for an order. It took me a minute to realize that the ORDER_ID is the long form shopify order id. It should be about 9 to 10 digits.