What is the supossed scope for translating file format to SFV? - authorization

Im going along with the tutorial from:
https://forge.autodesk.com/en/docs/model-derivative/v2/tutorials/prepare-file-for-viewer/
and i got stuck with translating the file to SVF. I've tried data:write, data:create, bucket:update scopes but each time I get:
Token does not have the privilege for this request.
{
"input": {
"urn": "someUrn="
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d",
"3d"
]
}
]
}
}

You will need both data:read and (data:write or data:create) (delimited by space) - see doc here:
curl -v 'https://developer.api.autodesk.com/authentication/v1/authenticate'
-X 'POST'
-H 'Content-Type: application/x-www-form-urlencoded'
-d '
client_id=obQDn8P0GanGFQha4ngKKVWcxwyvFAGE&
client_secret=eUruM8HRyc7BAQ1e&
grant_type=client_credentials&
scope=data:read%20data:write
'
And did you select Model Derivative API when creating the Forge app - if not, start over and create the app again:

Thanks,
I've run also with some different translation errors, but it turns out .rfa files are not supported in the Model Derivative API.
But all in all it worked out

Related

Trying to POST data to ElasticSearch server 8.6, but getting error "no handler found for uri"

I'm trying to send data to an ElasticSearch server using CURL. There is an index called 'datastream2' which has a lot of fields sorta like this:
"datastream2": {
"mappings": {
"properties": {
"UA": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 512
}
}
},
"accLang": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}...
I'd like to use CURL to send data to this index.
I've been using CURL for the attempted POST like this:
curl -v -X POST http://66-228-66-111.ip.linodeusercontent.com:9200/datastream2/newdocname -H "Content-type: application/json" --user elastic:u34XXXc2qYNGnVS4XXXA -d '{"UA":"Mozilla","acclang":"eng"}'
but it's failing with the message:
{"error":"no handler found for uri [/datastream2/newdocname] and method [POST]"}%
I will admit that I'm not sure what to put after the indexname of '/datastream2/' , but I've tried various different values. Some documentation says to list the type (which I'm not sure where to find) and some docs say that this is no longer necessary on ElasticSearch 8+ .
Any ideas how I can get this data posted into ElasticSearch?
You just need to replace newdocname by _doc and it will work
curl -v -X POST http://66-228-66-111.ip.linodeusercontent.com:9200/datastream2/_doc

Printful Oauth Api Prod. Upload

Description:
Oki, i am trying to upload products to printful via api
|> __ they changed to oauth and the docs are not matching anymore
|> __ the functionality itself is in their docs, but i cant get it to auth
|> __ their dev support was not helpful and i am not a api person
Assets:
=>> https://developers.printful.com/docs/#section/Products-API-examples/Create-a-new-Sync-Product
=>> https://developers.printful.com/docs/#operation/createSyncProduct
Code:
heres my error and code basically directly from their docs:
{"code":200,"result":"Welcome to the Printful API","extra":[]}
{"code":400,"result":"This API endpoint applies only to Printful stores based on the
Manual Order / API platform.
Find out more at Printful API docs.","error":{"reason":"BadRequest","message":
"This API endpoint applies only to Printful stores based on the Manual Order
/ API platform. Find out more at Printful API docs."}}%
# Authorized CURL request with Basic auth
curl -X GET 'https://api.printful.com/' \
-H 'Authorization: Bearer TOKEN'
curl --location --request POST 'https://api.printful.com/store/products' \
-H 'Authorization: Bearer SAMEtOKEN' \
--data-raw '{
"sync_product": {
"name": "T-Shirt",
"thumbnail": "https://picsum.photos/200/300"
},
"sync_variants": [
{
"retail_price": 21.00,
"variant_id": 4011,
"files": [
{
"url": "https://picsum.photos/200/300?image=1"
},
{
"type": "back",
"url": "https://picsum.photos/200/300?image=1"
}
]
},
{
"retail_price": 21.00,
"variant_id": 4012,
"files": [
{
"url": "https://picsum.photos/200/300?image=1"
},
{
"type": "back",
"url": "https://picsum.photos/200/300?image=1"
}
]
}
]
}'
To save anyone else the headache:
The Printful 'Create Product' and similiar API calls don't work with shops created via the automatic API integrations:
As far as I'm aware there is no workaround, but if I find one I'll update here. The name is a bit misleading, as the 'Sync Products' seem to describe products capable of syncing with external services. However you are limited to the ECommerce Platform Sync API calls. It seems to be possible to modify an existing one, but that doesn't help much for GUI-free automation.
Maybe you can you create a number of placeholders as 'Drafts' and modify, but haven't gotten that running myself yet.

Cannot create new Pipeline using Az DevOps Pipelines API 6.0-preview.1

I'm trying to create new Pipelines using this API endpoint:
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.0-preview.1
This is the request I'm using:
curl -X POST \
'https://dev.azure.com/<myorg>/<myproj>/_apis/pipelines?api-version=6.0-preview.1' \
-H 'Authorization: Basic <b64string>' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"configuration":{
"repository": {
"id": "<repo-guid>",
"name": "<repo-name>",
"type": "azureReposGit"
},
"path": "pipeline.yaml",
"type": "yaml"
},
"folder": "\\custompath\\",
"name": "<pipelinename>"
}
I keep getting the same error:
{
"$id": "1",
"innerException": null,
"message": "Value cannot be null.\r\nParameter name: repositoryName",
"typeName": "System.ArgumentNullException, mscorlib",
"typeKey": "ArgumentNullException",
"errorCode": 0,
"eventId": 0
}
It seems an issue with my payload, but documentation isn't very helpful about it
https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.0
Current version o nodejs sdk doesn't support the Pipeline API yet. Can anyone help me?
I'm able to reproduce your issue on my side, and have reported this issue at website below:
https://developercommunity.visualstudio.com/content/problem/1101376/create-pipeline-rest-api-does-not-work.html
Product team has provided response that "A fix for this issue has been prepared. It should be released to everyone within the next 3 weeks."

How to send result in survey monkey using CURL

I create a new survey form using survey monkey, and i get all questions using api and create custom form in my site. Now how can we update the result in survey monkey using CURL. I tired this /surveys/{id}/pages/{id}/questions/{id} but no response.
Version : V3
By "update the result" I presume you mean you want to create a new response for your survey.
You can do that with the response API. There is cURL examples on the right side of the page. Something along the lines of:
curl -i -X POST https://api.surveymonkey.net/v3/collectors/{collector_id}/responses \
-H "Content-Type: application/json" -H "Authorization:bearer <your_access_token>" \
-d '{
"pages": [{
"id": "<page_id>",
"questions": [{
"answers": [{
"choice_id": "<choice_id>"
}],
"id": "<question_id>"
}, {
"answers": [{
"text": "<open ended response>"
}],
"id": "<question_id>"
}]
}]
}'
Depending on the question types you have in your survey. Make sure you have a collector created already.
Given you are just trying to embed a survey on your website, I recommend you just use a website collector instead of trying to automate this yourself (depending on your use case).

ICINGA2 API Not making host modification

i have problem with the API of ICINGA2.
i'm trying to add new variables with the POST call ,
i'm getting the required result,
But ICINGA2 didn't add the new var.
According to documentation:
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/icinga2-api
With the following API, i creates all our hosts in vienna :
curl -k -s -u root:icinga -H 'Accept: application/json' -X PUT 'https://localhost:5665/v1/objects/hosts/server.example.com' \
-d '{ "templates": [ "generic-host" ], "attrs": { "zone": "Vienna", "address": "180.33.1.123", "check_command": "hostalive", "vars.os" : "Linux", "vars.agent" : "ssh" } }' \
| python -m json.tool
While this part works as expected,
The problem is once host created, i need to add various vars for different servers.
for example
Adding of the variable: "vars.servicename" : "DHCP_Servers"
If i'm going back to the documentation, the below API that will need to be execute:
curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/objects/hosts/server.example.com' \
-d '{ "templates": [ "generic-host" ], "attrs": { "zone": "Vienna", "address": "180.33.1.123", "check_command": "hostalive", "vars.os" : "Linux", "vars.agent" : "ssh", "vars.servicename" : "DHCP_Servers" } }' \
| python -m json.tool
When i ran the API , as expected i'm getting back:
{
"results": [
{
"code": 200.0,
"name": "server.example.com",
"status": "Attributes updated.",
"type": "Host"
}
]
}
But there is no changes that taking place on ICINGA/ host file.
Obviously the same user as in my inbox and the forums (https://monitoring-portal.org/index.php?thread/37160-adding-vars-with-api/&postID=234885#post234885) lately. Leaving this as a note here as it might help others to see why it does not work. That feature is just not implemented as it involves storing the applied changes, do a rollback, and re-apply. Not as simple as it sounds.
https://dev.icinga.org/issues/11501