Marketing activities empty list

Marketing activities empty list

camLux
Shopify Partner
3 0 0

I'm trying to query marketingEvents for my store using both the REST and GraphQL endpoints and they're both returning an empty list. I'm using the shopify_python_api. 

 

# make a rest call to get marketing events
events = shopify.MarketingEvent.find(limit=250)
pprint.pprint(events)

# graphql query to get marketing events
query = """
 {
marketingActivities(first:10){
edges{
node{
createdAt
status
app {
id
}
marketingEvent {
id
}
}
}
}
}
"""
graphql_response = shopify.GraphQL().execute(query)
pprint.pprint(graphql_response)

 

Both approaches return an empty result set 

[]

'{"data":{"marketingActivities":{"edges":[]}},"extensions":{"cost":{"requestedQueryCost":32,"actualQueryCost":2,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":998,"restoreRate":50.0}}}}'

 

I've confirmed my api key has the correct scopes:

Screenshot 2023-12-26 at 9.50.54 PM.png

Replies 3 (3)

Liam
Shopify Staff
2873 312 821

Hi CamLux,

 

Can you make this query without using the shopify_python_api? EG: by using the graphiql app? If the call can be made via the graphiql app, then this issue is related to the python API.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

camLux
Shopify Partner
3 0 0

Thanks for your response. When using the graphiql_app it works and I see data 

camLux_0-1703992703061.png

 

But when making a request via postman the very same query gives me an internal server error. Shouldn't I be able to access this data?  

camLux_1-1703992788229.png

 

"message": "Internal error. Looks like something went wrong on our end.\nRequest ID: f3186755-dc01-4f77-87b1-32fd452b77b5 (include this in support requests).",

"extensions": {

"code": "INTERNAL_SERVER_ERROR",

"requestId": "f3186755-dc01-4f77-87b1-32fd452b77b5"

}
Liam
Shopify Staff
2873 312 821

Hi again CamLux,

 

So if the query is working with the GraphiQL app but not with your own, there could be some configuration, or authentication issue preventing it. Does your app have the same permissions set up as the scopes you added to the GraphiQL app?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog