OpenAI Image URL Expiry Issue When Creating Ghost Post

:bullseye: What is your goal?

OpenAI Image URL Expiry Issue When Creating Ghost Post

:thinking: What is the problem & what have you tried?

Ghost does not provide an “Upload Image” module in Make. If that were available, I could upload the image to Ghost first and then map the returned URL in the final post.

Ghost → “Make an API call” does not support multipart/form-data in the body.

HTTP → “Make a request” requires a JWT token for authentication. The JWT token cannot be generated without hmac(), but Make does not support hmac(). It only supports sha256().

From Make’s docs:

sha256 (text; [encoding]; [key]; [key encoding])
Calculates the sha256 hash of a string. If the key argument is specified, sha256 HMAC hash is returned instead. Supported encodings: hex (default), base64 or latin1.

Apply the Ghost secret as key and build your JWT for authentication using the HTTP module.

The only drawback is that your SECRET will be available in the scenario.

@damato

1 Like

Thanks for helping @damato

I tried a lot but,

Due to the lack of a true hex-to-binary conversion function in Make, generating a fully compliant HMAC-SHA256 Base64URL JWT signature purely within Make is not reliably achievable.

Did you try with the Code app?

2 Likes

Thanks @Stoyan_Vatov

It works for me.