Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

application integration - API trigger with input variables

I want to invoke a application integration process by passing input variable values, getting error as below. please advise?

input_pagesize is a integer variable, and need to pass input.

curl -X POST -H "Content-Type: application/json" -d '{
"trigger_id": "api_trigger/BQTest_API_1",
"inputParameters": {
"input_pagesize": {
"integerValue": "2"
}
}
}' 'https://integrations.googleapis.com/v1/projects/svc-apigee-dev-05/locations/us-west2/integrations/BQ...' -H "Authorization: Bearer $(gcloud auth print-access-token)"

 

Error:

{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"integerValue\" at 'input_parameters[0].value': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "input_parameters[0].value",
"description": "Invalid JSON payload received. Unknown name \"integerValue\" at 'input_parameters[0].value': Cannot find field."
}
]
}
]
}
}

Solved Solved
0 4 382
1 ACCEPTED SOLUTION

I found an answer, it should be 'intValue'

View solution in original post

4 REPLIES 4

with string input value it works with the given payload value, but with integer input value its not working with integerValue or integer, what data type have to use?

 

{
    "trigger_id": "api_trigger/BQTest_API_1",
    "inputParameters": {
        "testvar": {
            "stringValue": "2"
        }
    }
}

Can you try your original curl with this :

"integerValue": 2

Note, your original value has the 2 in quotes like this: "integerValue": "2" 

@shaaland I tried it didn't work. Here is request/response payload

padmanabham_venkiteela@cloudshell:~ (svc-apigee-dev-05)$ curl -X POST -H "Content-Type: application/json" -d '{
"trigger_id": "api_trigger/BQTest_API_1",
"inputParameters": {
"input_pagesize": {
"integerValue": 2
}
}
}' 'https://integrations.googleapis.com/v1/projects/svc-apigee-dev-05/locations/us-west2/integrations/BQ...' -H "Authorization: Bearer $(gcloud auth print-access-token)"
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"integerValue\" at 'input_parameters[0].value': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "input_parameters[0].value",
"description": "Invalid JSON payload received. Unknown name \"integerValue\" at 'input_parameters[0].value': Cannot find field."
}
]
}
]
}
}

I found an answer, it should be 'intValue'