Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search


  • Posts

  • Joined

  • Last visited

Everything posted by teddy2x

  1. I saw that. The form fields for that application don't make sense though. The application asks for "Link to app logo", "Link to privacy policy", "Link to terms and conditions", "Initiate URL", etc. I just want to subscribe to my own order notifications. Have you been through this process before? Got any tips?
  2. I've generated an API key with the proper permissions to use Commerce Webhooks API. I'd like to create a subscription using the Webhooks API. I receive authorization error: "OAUTH_TOKEN_REQUIRED" How do you get OAuth token?
  3. Hello everyone, I'm trying to upload a product image on my AWS backend using Node.js. I've thoroughly read documentation on how to do this with a curl request and I have no problem doing so. (Please do not direct me to that doc.) I am continually receive INVALID_REQUEST_ERROR - The provided file could not be read as an image. No matter what I do! Does anyone have a working example of a Javascript POST request to commerce API? ------------------------------------------------------------------------------------------------------------ This is my current upload flow this: 1). My API receives upload file - looks something like this: Content-Disposition: form-data; name="file"; filename="thumbnail.png"Content-Type: image/png�PNG.... 2). That file is then parsed - example: {content: <Buffer fd 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 36266 more bytes>,filename: 'thumbnail.png',contentType: 'application/octet-stream',encoding: '7bit',fieldname: 'file'} 3). I then form request to the commerce api - formed request example: REQUEST PARAMS = {method: 'POST',headers: {'User-Agent': 'XXXX',Authorization: 'Bearer XXXXXXXXXXXXXXXXXXXXXXXX','content-type': 'multipart/form-data; boundary=--------------------------186703744268236431415530'},body: FormData {_overheadLength: 154,_valueLength: 181756,_valuesToMeasure: [],writable: false,readable: true,dataSize: 0,maxDataSize: 2097152,pauseStreams: true,_released: false,_streams: ['----------------------------186703744268236431415530\r\n' +'Content-Disposition: form-data; name="file"; filename="thumbnail.png"\r\n' +'Content-Type: image/png\r\n' +'\r\n','/VBORw0KGgoAAAANSUhEU 3). This is the response I receive from the Commerce API: {type: 'INVALID_REQUEST_ERROR',subtype: null,message: 'The provided file could not be read as an image.',details: null,contextId: 'MEPRIECOYBREYASWOOBO'} I have also tried using my API as a passthrough and just forward request body and specific headers to commerce API but receive the same error. Even when I'm forwarding a curl request that I know works! Do I need to do something special with my parsed image's Buffer before posting to commerce API? Is this even possible? Thanks in advance!
  • Create New...