Skip to content

ApplicationIntegrations create_notification not working #2018

Description

@rmunoz10

Hello,
create_notification works in Postman using correct parameters for the sandbox but does not work in the API using the same parameters. Attached image shows successful run using Postman.
Not sure what I may be missing.
Thanks

Image

Environment: Ubuntu 24.04 LTS.

*** ERROR ***

Exception has occurred: SellingApiBadRequestException
[{'code': 'InvalidInput', 'message': 'Could not match input arguments', 'details': ''}]
File ".../main.py", line 141, in
res = client.create_notification(body = data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sp_api.base.exceptions.SellingApiBadRequestException: [{'code': 'InvalidInput', 'message': 'Could not match input arguments', 'details': ''}]

*** TO REPRODUCE ***

_API_REFRESH_TOKEN='xxxxxx'
CLIENT_ID='xxxxxxxx'
CLIENT_SECRET='xxxxxxxxxxxxxxxx'
AWS_ACCESS_KEY='xxxxxxxxx'
AWS_SECRET_KEY='xxxxxxxxxxxxxxxx'
BASE_URL='https://sandbox.sellingpartnerapi-na.amazon.com'

CREDENTIALS = dict(
refresh_token=_API_REFRESH_TOKEN,
lwa_app_id=CLIENT_ID,
lwa_client_secret=CLIENT_SECRET,
aws_access_key=AWS_ACCESS_KEY,
aws_secret_key=AWS_SECRET_KEY,
)

client = ApplicationIntegrations(
credentials=CREDENTIALS,
)

client.endpoint = BASE_URL
data = {
"templateId": "PRICE_CHANGE",
"notificationParameters": {
"priceValue": "200"
},
"marketplaceId": "ATVPDKIKX0DER"
}
res = client.create_notification(body = data)

*** POSTMAN WORKS ***
https://sandbox.sellingpartnerapi-na.amazon.com/appIntegrations/2024-04-01/notifications

body
{
"templateId": "PRICE_CHANGE",
"notificationParameters": {
"priceValue": "200"
},
"marketplaceId": "{{marketplace}}"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions