Question

Uploading to GDrive failed after successful "Send API Request for Dall-E 3" action

  • 17 November 2023
  • 6 replies
  • 88 views

Hi All,

 

I’m hitting s hard-wall on what I’m trying to achieve: I’d like to generate an image with Dall-e 3 and upload it on a GDrive.

Since I don’t seem to have the dall-e 3 model available in the send prompt, I used Troy’s suggestion (Here) and used the API Request, with all correct parameters. As a matter of fact I got the the 200 response code and the URL on the Azure Blob (https://oaidalleapiprodscus.blob.core.windows.net/private...etc etc). 

The issue comes with step 2 (i.e. Upload on GDrive). When I enter the previous URL (i.e. “Response Data Data URL”) in the Gdrive - Upload action, it doesn’t work and I get the following error: 

“Failed to create an upload file in Google Drive

The app returned "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.".“

 

Can someone please help me figuring out what’s missing?

Many thanks in advance,

Alex


6 replies

Userlevel 7
Badge +14

Hi @Xperim0660 

Good question.

Please post screenshots with how your GDrive Zap step is configured to give us context.

Hi @Troy Tessalone ,

many thanks for your feedback. Here’s the screenshot.

 

Basically, the flow goes as follows:

  1. get a record from Sheets;
  2. perform a check on 1 field of the extracted record; this is needed just to ensure the data is actually ready to be processed by the next action;
  3. generate images via API request (here I basically call the API you’ve also mentioned in a previous post. All parameters are correct, and gives me back a Response Data URL
  4. I find a specific PNG file on GDrive;
  5. I replace it (see screenshot above) with the Response Data Data Url I get from OpenAI API.

I’m aware the URL has an expiration, and I’ve tried to access it within 1 minute of its generation, but it doesn’t work and gives me the following error:

 

I was wondering if, instead of the default response_format “url” (from Dall-E 3), I should actually request a “b64_json” and manipulate that afterwards (even though I wouldn’t know how to handle that in Zapier, without writing custom python code).

 

Any suggestions you might have would be very welcome!

 

Many thanks in advance,

Alex   

Userlevel 7
Badge +14

@Xperim0660 

Can you show how the OpenAI step is configured along with the returned data?

 

Hi @Troy Tessalone ,

sure, here it is:

 

...and the output, after having run the test is this:

 

 

...scrolling further down in the output, you can see the generated response data URL:

🔍_full_response_data_🔎

https://zapier.com/engine/hydrate/15336316/.eJw1zU0OgjAQhuG7zBq0tT9Ydp7DGFLawTRAS2iJEsLdrUS37zd5ZgMTfEKfmrROCDXcoADnY9LeYOMs1JyxC2UVK8AsMYVxiTgfAxWMSUZlAdqYsGTiXwUnqoDO4WA[OMITTED...it’s basically the data below]

request

method

POST

url

https://api.openai.com/v1/images/generations

querystring

headers

content-type

application/json

body

{ "model": "dall-e-3", "prompt": "a cat carrying a piano", "n": 1, "size": "1024x1024" }

data

model

dall-e-3

prompt

a cat carrying a piano

n

1

size

1024x1024

response

status

200

headers

access-control-allow-origin

*

alt-svc

h3=":443"; ma=86400

cf-cache-status

DYNAMIC

cf-ray

82976bfe3853081b-IAD

connection

close

content-encoding

gzip

content-type

application/json

date

Tue, 21 Nov 2023 08:04:39 GMT

openai-organization

[OMITTED]

openai-processing-ms

13196

openai-version

2020-10-01

server

cloudflare

set-cookie

__cf_bm=hrPS3zaoMw6p0xGONpMipomKhnwiY5x1qrMUnekavPY-1700553879-0-AVHu69cBK3f2/lYRuR30jEpED95l1Cu5CgCPS1BSCB3ejcn9yeESUJqQ37BQmThRH9d877BGDSwRJzN80ZdKknA=; path=/; expires=Tue, 21-Nov-23 08:34:39 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None, _cfuvid=j94WNImtOz1o3xEMH0ywXX.jldEGk0CVePYs0FPqnpk-1700553879199-0-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None

strict-transport-security

max-age=15724800; includeSubDomains

transfer-encoding

chunked

x-request-id

7a5ac4e450b9cb723e786dcbcb2c94bf

body

{ "created": 1700553879, "data": [ { "revised_prompt": "Imagine a domestic feline exhibiting a supernatural strength. The cat has a vibrant fur, a mixture of orange and white, with expressive green eyes. It effortlessly carries a small miniaturized grand piano, classical in design with a glossy black finish. The keys are clean and white, contrasting beautifully against the black body. Despite the piano's size being quite smaller than the usual, it still appears quite significant in comparison to the cat. Feel the amusing absurdity of the scene.", "url": "https://oaidalleapiprodscus.blob.core.windows.net/private/:censored:28:ff05a144d3:/user-[OMITTED]/img-eDk7SinJ4tO62NCZ3NmvPUZs.png?st=2023-11-21T07%3A04%3A39Z&se=2023-11-21T09%3A04%3A39Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-20T20%3A16%3A33Z&ske=2023-11-21T20%3A16%3A33Z&sks=b&skv=2021-08-06&sig=fHV3rU90j2czMvTSfzfA3mX%2BkrzixmP%2BR5nsAiqp5rc%3D" } ] }

data

created

1700553879

data

1

revised_prompt

Imagine a domestic feline exhibiting a supernatural strength. The cat has a vibrant fur, a mixture of orange and white, with expressive green eyes. It effortlessly carries a small miniaturized grand piano, classical in design with a glossy black finish. The keys are clean and white, contrasting beautifully against the black body. Despite the piano's size being quite smaller than the usual, it still appears quite significant in comparison to the cat. Feel the amusing absurdity of the scene.

url

https://oaidalleapiprodscus.blob.core.windows.net/private/:censored:28:ff05a144d3:/user-[OMITTED]/img-eDk7SinJ4tO62NCZ3NmvPUZs.png?st=2023-11-21T07%3A04%3A39Z&se=2023-11-21T09%3A04%3A39Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-20T20%3A16%3A33Z&ske=2023-11-21T20%3A16%3A33Z&sks=b&skv=2021-08-06&sig=fHV3rU90j2czMvTSfzfA3mX%2BkrzixmP%2BR5nsAiqp5rc%3D

 

Any idea what is happening?

Thanks a lot in advance for your help,

Massimo

Userlevel 7
Badge +11

Hi @Xperim0660! 👋

This is very strange indeed. It looks as though you’ve got the Zap set up correctly. I’ve just done some testing in my own account and was able to successfully generate an image, view it at the URL provided and upload it to a Google Drive folder, based on the same set up as shown in your screenshots. 

The images should expire after 1 hour according to OpenAI’s documentation so it should give plenty of time for the Zap to process them. As the error is referencing an issue with the authentication perhaps there could be something wrong with the API Key?

To test out that theory can you try the following:

  • Generate a new API Key in your OpenAI account here: https://platform.openai.com/api-keys and copy it.
  • Next, head back to the Zap and create a new OpenAI account connection that uses that new API Key.
  • Once you’ve added that new OpenAI app account connection, test the OpenAI action again to get it to generate a new image. 
  • Then test the Google Drive actions in the Zap again.


Can you give that a try and let us know if it then allows you to successfully replace the Google Drive file with the newly generated png image?

Looking forward to hearing from you on this! 

Userlevel 7
Badge +14

@Xperim0660 

I tested too and was able to successfully replace a GDrive file with an image from OpenAI.

Make sure to retest each Zap step.

Also, try turning the Zap ON and testing live.

Reply