• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Calling an HTTPS API from JSX

New Here ,
Mar 23, 2016 Mar 23, 2016

Copy link to clipboard

Copied

Hi,

I'm trying to call a HTTP API (which is mine) from InDesign. The API returns JSON and is publicly accessible over HTTPS (HTTP doesn't work!).

Now i tried the GetURL functionality as described in this blogpost (Rorohiko: GetURLs.jsx - access HTTP content from InDesign ExtendScript) and the http.get() from Extendables (http: sending and receiving http requests — Extendables v0.3a documentation)

With both methods HTTP calls work fine but my API requires the call to be over HTTPS and I can't seem to figure out how to do this.

I tried to set the host to e.g. "Host: myendpoint.com:443" but that also doesn't work.

I also have no clue what the culprit is. The Socket error (socket.error) is empty and can't seem to find any other error reporting facilities.

Hope you know what the problem is and how to fix it!

Thanks,

Zeger

Views

7.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 23, 2016 Mar 23, 2016

Just $0.02 but I believe you've found the end of the support for the HTTP abilities of the Extendables framework.

The 2 cent part is, although it's much more challenging, Adobe's script API can make use of other languages with more features, such as COM / VBScript on Windows and AppleScript on OSX. The script API can hand the request to those languages in addition (or a c++ library) and they can fully handle the request and then would need to return the data back to the script API. Not for the fe

...

Votes

Translate

Translate
LEGEND ,
Mar 23, 2016 Mar 23, 2016

Copy link to clipboard

Copied

Just $0.02 but I believe you've found the end of the support for the HTTP abilities of the Extendables framework.

The 2 cent part is, although it's much more challenging, Adobe's script API can make use of other languages with more features, such as COM / VBScript on Windows and AppleScript on OSX. The script API can hand the request to those languages in addition (or a c++ library) and they can fully handle the request and then would need to return the data back to the script API. Not for the feint of heart.

Finally, while it's certainly not the most silky road, you might consider sort of a 'proxy', similar to how CORS is is sometimes handled. If you have a script on a web server (any language), say, PHP, you could send a HTTP request to it specifying the HTTPS target and any other arguments, while PHP then performs the HTTPS request and returns the information back to you in HTTP. Not elegant but there's always several ways to handle any situation.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2016 Mar 25, 2016

Copy link to clipboard

Copied

We considered both of the options you describe and hoped there would be a better way to deal with this.

Anyways, thanks for your reply and we'll see how we'll fix this!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 25, 2016 Mar 25, 2016

Copy link to clipboard

Copied

You're welcome and good luck!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

LATEST

Hi all,

Just a quick note: I've revisited the old GetURL and made a more modern version which does support https as well as http. All smoke and mirrors. More information and source code on my personal blog:

http://coppieters.nz/?p=133

Cheers,

Kris (Rorohiko)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines