INVALID_ARGUMENT projects.locations.transferConfig.create - google-bigquery

I try to create projects.locations.transferConfig.create on the page
https://cloud.google.com/bigquery/docs/reference/datatransfer/rest/v1/projects.locations.transferConfigs/create
set parent projects/1069829667403/locations/eu
and Request body
{
"dataRefreshWindowDays": 10,
"destinationDatasetId": "stat",
"displayName": "test",
"dataSourceId": "adwords",
"params": {
"customer_id": "5030341011"
}
}
and have error
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
What am I doing wrong?

Request body should look like this:
{
"dataRefreshWindowDays": 10,
"destinationDatasetId": "stat",
"displayName": "test",
"dataSourceId": "adwords",
"params": {
"fields": {
"key": "customer_id",
"value": {
"string_value": "5030341011"
}
}
}
}

Related

"message": "Invalid Json Request" in postman response

I'm trying to do a POST request from postman to cybersource url: https://apitest.cybersource.com/pts/v2/payments
and I'm getting the below error message
{
"submitTimeUtc": "2023-01-18T21:52:02.539Z",
"status": "DECLINED",
"errorInformation": {
"reason": "INVALID_DATA",
"message": "Invalid Json Request"
}
}
this is my body request
{
"clientReferenceInformation": {
"code": "TC50171_3"
},
"paymentInformation": {
"card": {
"number": "4111111111111111",
"expirationMonth": "12",
"expirationYear": "2031"
}
},
"orderInformation": {
"amountDetails": {
"totalAmount": "102.21",
"currency": "USD"
},
"billTo": {
"firstName": "John",
"lastName": "Doe",
"address1": "1 Market St",
"locality": "san francisco",
"administrativeArea": "CA",
"postalCode": "94105",
"country": "US",
"email": "test#cybs.com",
"phoneNumber": "4158880000"
}
}
}
and this are my Headers
what am I doing wrong here?
can anyone help me?

Unable to retrieve data from catalog using WhatsApp Cloud API

I'm unable to send multiproduct messages to users. Every time I send the request I receive the same error. The following attachment shows the catalog connected to the number.
The body of the request:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "###########",
"type": "interactive",
"interactive": {
"type": "product_list",
"header": {
"type": "text",
"text": "text-header-content"
},
"body": {
"text": "text-body-content"
},
"footer": {
"text": "text-footer-content"
},
"action": {
"catalog_id": "673529427462715",
"sections": [
{
"title": "the-section-title",
"product_items": [
{
"product_retailer_id": "K456653445"
}
]
}
]
}
}
}
The error received:
{
"error": {
"message": "(#131009) Parameter value is not valid",
"type": "OAuthException",
"code": 131009,
"error_data": {
"messaging_product": "whatsapp",
"details": "None of the products provided could be sent. Please check your catalog."
},
"error_subcode": 2494010,
"fbtrace_id": "A4YbEq8SQ7rMIisuc4M2HiX"
}
}

error 403 when i post create request to openstack with restapi , how to fix?

I'm trying to do a post request for creating a server in the openstack using REST API. I tried this code (followed in the Openstack documentation) but it response 403 error code
request for token
{ "auth":
{ "identity":
{ "methods": ["password"],
"project": "7646jkkjds876tdsuhi87fd4d2a953ca3f4",
"password":
{"user":
{"domain":{"name": "default"},
"name": "test",
"password": "zxcZXC123#"
}
}
}
}
}
and my Request for creating the Server
{
"server": {
"name": "test-vm1",
"imageRef": "c8d859c9-ce15-4673-a486-5524ba1e41ff",
"flavorRef": "0",
"max_count": 1,
"min_count": 1,
"networks": [
{
"uuid": "01f1888b-1d12-4e6c-9936-d8175e71f311"
}
],
"security_groups": [
{
"name": "default"
}
]
}
}
please help me
I found the answer. This error is shown when you don't send the project scope in the API token. I corrected my JSON like this and it's done.
{ "auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"name": "test",
"domain": { "id": "default" },
"password": "zxcZXC123"
}
}
},
"scope": {
"project": {
"name": "test",
"domain": { "id": "default" }
}
}
}
}

Whatsapp API (#132000) Number of parameters does not match the expected number of params

I created below template in Whatsapp API. And I want to set the parameter value in the API call. What is the correct payload ? I have been following the Meta docs and trying but everytime I get error. Please Help.
Template:
You order # {{1}} is received successfully.
I used this payload:
{
"messaging_product": "whatsapp",
"to": "918456712349",
"type": "template",
"template": {
"name": "order_notification",
"language": {
"code": "en_US"
}
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "135345345"
}
]
}
]
}
But I am still getting this error
{
"error": {
"message": "(#132000) Number of parameters does not match the expected number of params",
"type": "OAuthException",
"code": 132000,
"error_data": {
"messaging_product": "whatsapp",
"details": "body: number of localizable_params (0) does not match the expected number of params (1)"
},
"error_subcode": 2494002,
"fbtrace_id": "AzPa-uWXctIcdNVu0Lf3Fic"
}
}
The issue due to closing the template object then opening a new component object.
make the component object inside the template object and it will be fixed
{
"messaging_product": "whatsapp",
"to": "918456712349",
"type": "template",
"template": {
"name": "order_notification",
"language": {
"code": "en_US"
}
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "135345345"
}
]
}
]
}
}
change in parameter type "header", this code run for me:
{
"messaging_product": "whatsapp",
"to": "918456712349",
"type": "template",
"template": {
"name": "order_notification",
"language": {
"code": "en_US"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "text",
"text": "xxxxxxx"
}
]
}
]
}
}
Looks like the template is expecting 1 parameter, which is not being provided.
You can look at the documentation and example here.
It includes a working example.

I get "invalid id" when using the new fileDelete to remove a file from the admin page

I've been able to make a script to save a file using the new fileCreate but when I try to delete a file with fileDelete, I can't seems to get the right ID.
mutation fileDelete($fileIds: [ID!]!) {
fileDelete(fileIds: $fileIds) {
userErrors {
field
message
}
deletedFileIds
}
}
I pass the ID from my last image: "gid://shopify/ImageSource/20805776113730", called with a new private app key (which should use the v2021-10)
If anybody got that mutation to work, I would appreciate any help.
Response from Shopify:
{
"data": {
"fileDelete": null
},
"errors": [{
"message": "invalid id",
"locations": [{
"line": 3,
"column": 4
}],
"path": ["fileDelete"]
}],
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 1,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 999,
"restoreRate": 50
}
}
}
}
Here is what's send:
{
"query": "mutation fileDelete($fileIds: [ID!]!) {\r\n\t\t\tfileDelete(fileIds: $fileIds) {\r\n\t\t\t userErrors {\r\n\t\t\t\tfield\r\n\t\t\t\tmessage\r\n\t\t\t }\r\n\t\t\t deletedFileIds\r\n\t\t\t}\r\n\t\t }",
"variables": {
"fileIds": "gid:\/\/shopify\/ImageSource\/20825330909250"
}
}
You need to send the ImageMedia ID:
{
"fileIds": "gid://shopify/MediaImage/20835931816073"
}
To get that ID, you need to send your request like this:
{
files(first: 99, reverse:true){
edges{
cursor
node{
... on MediaImage {
id
mimeType
image {
originalSrc
}
}
__typename
createdAt
fileStatus
preview{
image{
altText
id
transformedSrc
originalSrc
}
status
}
}
}
}
}
Response:
{
"data": {
"files": {
"edges": [
{
"cursor": "xxxxxx",
"node": {
"id": "gid:\/\/shopify\/MediaImage\/xxxx",
"mimeType": "image\/png",
"image": {
"originalSrc": "xxxx"
},
"__typename": "MediaImage",
"createdAt": "2021-10-21T17:39:58Z",
"fileStatus": "READY",
"preview": {
"image": {
"altText": "xxxx",
"id": "gid:\/\/shopify\/ImageSource\/xxxx",
"transformedSrc": "xxxx",
"originalSrc": "xxxx"
},
"status": "READY"
}
}
},
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 398,
"actualQueryCost": 18,
"throttleStatus": {
"maximumAvailable": 1000.0,
"currentlyAvailable": 982,
"restoreRate": 50.0
}
}
}
}