https://forge.autodesk.com/blog/how-patch-apis-work-and-some-tips-using-patch-apis
https://forge.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-versions-version_id-PATCH/
I have followed the two links above explaining how to PATCH a version of an item and update the name of it but I am getting errors. Below is what I inputted into Postman (version_id inside the URI has been already encoded):
URI: https://developer.api.autodesk.com/data/v1/projects/:project_id/versions/:version_id
Authorization: Bearer *****************************
Content-Type: application/vnd.api+json
Body:
{
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "versions",
"id": *********************************************,
"attributes": {
"name": "AAA - My PDF file.pdf",
"displayName": "AAA - My PDF file.pdf"
}
}
}
The item version I am trying to update is already named AAA - My PDF file.pdf so nothing should be updated. But when I send the request I get the following error.
Error:
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "30043cce-cfbe-4766-933c-fd9d888e574d",
"status": "400",
"code": "BAD_INPUT",
"title": "One or more input values in the request were bad",
"detail": "Request input is invalid for this operation."
}
]
}
Are there any ideas why I am getting this error and how can I fix it?
Unfortunately at the moment PATCHing for BIM360 Doc items is unsupported and hence the error. The error message could have been more specific rather than a general validation failure message and I will let Engineering know to update accordingly.
Try PATCHing with A360 hub and it should work as expected.
Related
I'm trying to retrieve from Postman the answers of a form I created on google form but I can't do it.
First of all I created a form on google form.
I sent it to a person to get some answers.
I followed this tutorial which allowed me to set up oauth 2.0 on postman https://www.vulongtran.com/how-to-use-postman-with-google-cloud-platform-apis
Then as indicated in the api documentation of google form, I put in postman the GET method and I pass him the following url:
I replace obviously the formId by the id of my form which is the following 1FAIpQLSdNlmrvlMXvUlhSjiTb7YsqjHCTYZNRlJlGJnwkxyzNNSPe3A
This gives me the following url:
This gives me the following url:
https://forms.googleapis.com/v1/forms/1FAIpQLSdNlmrvlMXvUlhSjiTb7YsqjHCTYZNRlJlGJnwkxyzNNSPe3A/response
Before sending the request from postman I go on Postman->Authorization and I select the token set up thanks to the tutorial of this site:
https://www.vulongtran.com/how-to-use-postman-with-google-cloud-platform-apis
This does not work I get the following error:
{
"error": {
"code": 403,
"message": "Request had insufficient authentication scopes.",
"status": "PERMISSION_DENIED",
"details": [
{
"#type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
"domain": "googleapis.com",
"metadata": {
"service": "forms.googleapis.com",
"method": "google.apps.forms.v1.FormsService.GetForm"
}
}
]
}
}
I am completely blocked if anyone can help me please?
Translated with www.DeepL.com/Translator (free version)
I am trying to build a workflow where in step1 I am running a cloud function which returns a Json Object in the form of python dictionary and I want the same to be inserted in Firestore using firestore connector. But I am getting the below error:
HTTP server responded with error code 400
in step "create_document", routine "main", line: 27
HTTP server responded with error code 400
in step "create_document", routine "main", line: 28
{
"body": {
"error": {
"code": 400,
"details": [
{
"#type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid JSON payload received. Unknown name \"field1\" at 'document.fields[0].value': Cannot find field.",
"field": "document.fields[0].value"
},
{
"description": "Invalid value at 'document.fields[1].value' (type.googleapis.com/google.firestore.v1.Value), 200",
"field": "document.fields[1].value"
},
{
"description": "Invalid JSON payload received. Unknown name \"Alt-Svc\" at 'document.fields[2].value': Cannot find field.",
"field": "document.fields[2].value"
},
{
"description": "Invalid JSON payload received. Unknown name \"Cache-Control\" at 'document.fields[2].value': Cannot find field.",
"field": "document.fields[2].value"
},
{
"description": "Invalid JSON payload received. Unknown name \"Content-Length\" at 'document.fields[2].value': Cannot find field.",
"field": "document.fields[2].value"
},
{
"description": "Invalid JSON payload received. Unknown name \"Content-Type\" at 'document.fields[2].value': Cannot find field.",
"field": "document.fields[2].value"
},
{
"description": "Invalid JSON payload received. Unknown name \"Date\" at 'document.fields[2].value': Cannot find field.",
"field": "document.fields[2].value"
}
This is how my workflow looks like
main:
params: [args]
steps:
- step1:
call: http.get
args:
url: https://XXXXXXXXXXXXX.cloudfunctions.net/step1-workflow
query:
bucket_name: ${args.bucket_name}
blob_name: ${args.blob_name}
result: key_val
- step2:
assign:
- project_id: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
- collection: "a-dummy-collection"
- document: "new7-dummy-document"
- create_document:
call: googleapis.firestore.v1.projects.databases.documents.createDocument
args:
collectionId: ${collection}
parent: ${"projects/" + project_id + "/databases/(default)/documents"}
query:
documentId: ${document}
body:
fields: ${key_val}
result: inserted
if in place of ${key_val} I use simple json {"field1": {"stringValue": "str1"},"field2": {"integerValue": 10}} it works fine and data gets inserted in the Firestore but if I try to use the object from variable ${key_val} which is in the same structure as mentioned json it gives error.
Answer given in the comments: the ${key_val} result from the call to the cloud function is actually returning the whole response object, not just the body. That's why in the error messages, you were seeing things like content-type and other headers.
The solution here is to say that we want the body of that response with: ${key_val.body}.
I'm attempting to to have an API Gateway act as a proxy to DynamoDB and I'm currently testing with a simple POST call to append the $context.requestId and $context.requestTime to my table. I am getting the following error message:
{
"__type": "com.amazon.coral.validate#ValidationException",
"message": "One or more parameter values were invalid: An AttributeValue may not contain an empty string"
}
and what is sent is:
Mon Apr 15 19:10:24 UTC 2019 : Endpoint request body after transformations: {
"TableName": "BurgerOrders",
"Item": {
"OrderId": {
"S": "1f54a90b-5fb2-11e9-8b31-c9003bb71ec2"
},
"RequestTime": {
"S": ""
}
}
}
The mapping template within Integration Request that I have is:
{
"TableName": "BurgerOrders",
"Item": {
"OrderId": {
"S": "$context.requestId"
},
"RequestTime": {
"S": "$context.requestTime"
},
}
}
I've tried to change $context.requestTime to $context.requestTimeEpoch and I get the same error.
I know this was posted a while back, but according to an AWS dev:
"At this time, [$context.requestTime] is only available when the API has been deployed and API call was invoked to deployed stage."
Source: https://forums.aws.amazon.com/thread.jspa?messageID=697652
I'm trying to create token with MPGS.
I'm following this guide:
https://sample-sub.domain.mastercard.com/api/documentation/integrationGuidelines/supportedFeatures/pickAdditionalFunctionality/tokenization/tokenization.html?locale=en_US#x_tokenConfiguration
In the section "Token Operations" > "Tokenize", it says:
You can use this operation to create or update a token by storing
payment details against the token. ...
I'm posting this to help people who are frustrating like me with MPGS. I faced series of issues, and pulled my hair off many times. So here's the issues I faced and how to solve them (I'm stuck with issue #4).
Issue #1: Invalid credentials.
Fix: Make sure you're hitting the correct URL.
https://example-subdomain.mastercard.com/..
https://some.other-example.mastercard.com/..
https://MILLION-OTHER-POSSIBILITIES.mastercard.com/..
Even the documentation guide link have these same sub-domains, so make sure you're hitting the correct URL, and make sure you're following the correct documentation link.
Issue #2: Invalid parameters, or server asking for parameters although you've provided them.
Fix: If using Postman, make sure you set the parameters in "Body" > "raw" as JSON, like so:
{
"sourceOfFunds": {
"provided": {
"card": {
"expiry": {
"month": "05",
"year": "21"
},
"number": "5123456789012346"
}
},
"type": "CARD"
}
}
Issue #3: Authorization required
Fix: If using Postman, click on "Authorization", set "Type" it to Basic Auth, for "Username" set it to merchant.YOUR_MERCHANT_ID, for "Password" set it to YOUR_API_PASSWORD
Issue #4 (stuck here): Value '9999999999999999' is invalid. Card token must not be supplied
Method: PUT
URL: https://test-my.sample.gateway.mastercard.com/api/rest/version/46/merchant/MY_MERCHANT_ID/token/9999999999999999
Authorization: set correctly in Authorization tab
Body > raw:
{
"sourceOfFunds": {
"provided": {
"card": {
"expiry": {
"month": "05",
"year": "21"
},
"number": "5123456789012346"
}
},
"type": "CARD"
}
}
Response:
{
"error": {
"cause": "INVALID_REQUEST",
"explanation": "Value '9999999999999999' is invalid. Card token must not be supplied",
"field": "tokenid",
"validationType": "INVALID"
},
"result": "ERROR"
}
Q: Not sure what to do to tokenize the transaction..?! I'm stuck with issue #4.
Ok, finally figured it out. MPGS has 2 ways to create/update tokens:
Tokenization where YOU provide the token (notice: PUT method)
Tokenization where MPGS generate the token for you (notice: POST method)
They're very similar.
I got it working with the 2nd option.
Note: This is POST method !!
Method: POST
URL: https://SUBDOMAIN_YOU_SHOULD_BE_USING.mastercard.com/api/rest/version/50/merchant/YOUR_MERCHANT_ID/token
In postman, set Authorization (as described in the question, in issue #3).
Sample data to send (in postman, this should be in Body > raw):
{
"sourceOfFunds": {
"provided": {
"card": {
"expiry": {
"month": "05",
"year": "21"
},
"number": "5123456789012346"
}
},
"type": "CARD"
}
}
Sample response:
{
"repositoryId": "1000000000002",
"response": {
"gatewayCode": "BASIC_VERIFICATION_SUCCESSFUL"
},
"result": "SUCCESS",
"sourceOfFunds": {
"provided": {
"card": {
"brand": "MASTERCARD",
"expiry": "0521",
"fundingMethod": "CREDIT",
"issuer": "BANCO DEL PICHINCHA, C.A.",
"number": "512345xxxxxx2346",
"scheme": "MASTERCARD"
}
},
"type": "CARD"
},
"status": "VALID",
"token": "9717501974559694",
"usage": {
"lastUpdated": "2019-02-25T09:36:54.928Z",
"lastUpdatedBy": "1015",
"lastUsed": "2019-02-25T09:36:54.928Z"
},
"verificationStrategy": "BASIC"
}
If I want my Actionable Message to send a HttpPOST to an Azure Function or Azure logic app, how do I get this working?
I have tried the following two senario's with out any luck:
Azure function with Azure Active Directory Authentication. When I call it, I get the following response:
{
"innerErrorCode":"ProviderException",
"innerErrorMessage":null,
"authenticationUrl":null,
"displayMessage":"The action could not be completed."
}
This target URL is registered in the Actionable Email Developer Dashboard.
The function is not even triggered, so the error is coming from
/actions/userid/messages/.../executeAction
call.
Azure function with no authentication, I get the following response:
{
"innerErrorCode":"InvalidTargetUrlException",
"innerErrorMessage":null,
"authenticationUrl":null,
"displayMessage":"Target URL
'https://mysite.azurewebsites.net/api/ActionableMessage' is not allowed."
}
Thanks
Can you share the actionable message json which you are using to send mail?
you need to have a entry in potential action as a input along with followed action e.g. a options multi select represented as:
{
"#type": "ActionCard",
"name": "SelectResource",
"inputs": [
{
"#type": "MultichoiceInput",
"id": "<id_which_will_be_used_for_fetching_value>",
"isRequired": true,
"title": "Pick an option",
"style": "expanded",
"choices": $6
}
],
"actions": [
{
"#type": "HttpPOST",
"name": "Select one of the resource for booking",
"target": "your_azure_function_url",
"body": "{{<id_of_the_input>.value}}" //will be received in function
}
]
}