Issues creating a new ResourceFeedback

lksenia
Tourist
9 1 3

Hi, I'm developing a Sales Channel and having issues with creating ResourceFeedback.

I'm building the app with Node.js + Typescript using shopify-api-node.

When I'm trying to create ResourceFeedback I always receive an error: 

The "url" argument must be of type string. Received undefined

This is the code for the request:

 

 

await shopify.resourceFeedback.create({
  state: 'requires_action',
  messages: ['is not connected. Connect your account to use this sales channel.'],
  feedback_generated_at: new Date().toISOString(),
});

 

 

The API docs do not specify any `url` field, that could be sent in the body of the request, but even if I do send the link to my app in the url field aside with `state` and `messages`, I still receive the same error. 

Thanks in advance

 

0 Likes
_JCC_
Shopify Staff
Shopify Staff
158 21 27

Hey @lksenia ,

The shopify-api-node npm module is not owned by Shopify it's an open source project. I believe the module emits a request-id from the response headers we send back from a request. If you have the x-request-id and can provide it I'm happy to investigate our logs.

I also was wondering if you tried making the request in Postman or Insomnia, taking the shopify-api-node library out of it as a test? If that succeeds then I would open an issue with the shopify-api-node repo. If a test in Insomnia or Postman fails, if you can provide the x-request-id from the response headers I'm happy to look into this further.

Regards,

John

John C | Developer Support @ 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

0 Likes
lksenia
Tourist
9 1 3

Hi John,

Thank you for your reply,

I've opened an issue, and the problem was the following: the response on creating a new resource is `202 Accepted`, which assumes that the resource was not created and further polling might be needed. But no 'location' or 'retry-after' headers are passed with the response.

It seems that the resource is actually created immediately, maybe it could send code 201 instead. And also since there's no chance of further polling.

Best regards,

Ksenia

0 Likes