Call a HTTPS API of JSX

Hello

I'm calling an HTTP API (which is mine) InDesign. The API returns JSON and are accessible to the public via HTTPS (HTTP does not work!).

Now, I tried the GetURL function, as described in this blogpost (Rorohiko: GetURLs.jsx - access HTTP content InDesign ExtendScript) and http.get () of has (http: send and receive requests http - has v0.3a documentation)

With both HTTP method calls work well, but my API requires the call to be over HTTPS and I can't seem to find a way to do it.

I tried to assign the host for example "Host: myendpoint.com:443" but who doesn't.

Also, I have no idea what is the culprit. The Socket error (socket.error) is empty and can't seem to find another error reporting facilities.

I hope that you know what is the problem and how to fix it!

Thank you

Zeger

Just $0.02, but I think that you have found the end of support for the framework HTTP capabilities has.

The piece of 2 cents, of whatever hard, Adobe API script can make use of other languages with more features, such as COM / VBScript on Windows and AppleScript on OSX. The script API may transfer to these languages in addition (or library c ++) and they can fully manage the request and then need to return data would support the API script. Not for the feint of heart.

Finally, while it is certainly not the most silky road, you might consider some kind of "power of Attorney", similar to how the CORS is sometimes treated. If you have a script on a web server (any language), say, PHP, you can send an HTTP request to it by specifying the target HTTPS and all other arguments, while PHP then performs the HTTPS request and returns the information back to HTTP. Not elegant, but there are always several ways to handle any situation.

Tags: Coding Corner

Similar Questions

  • The caller of the API do not have permission to perform this operation

    I generated an OAuth token and I get the following result every time that I have the query API (either directly or to try it out the tests here: https://secure.na1.echosign.com/public/docs/restapi/v5)

    {
    "message": "the caller of the API need not have permission to perform this operation."
    'code': "PERMISSION_DENIED".
    }


    I checked "on" for each single scope and set the modifier to the account (I also tried to change the group, but that made no difference). The key to OAuth has been authorized by the account used to register for this account of eSign. It is also a developer account, and it's under a user different from what I write under.


    Basically, all I want to do is get the status on all documents and see whether they are signed or not. I don't like that the user has permissions for that.


    Thank you!

    Hello Ollie,

    The error is specific to an API call or is happening with several API calls that you are trying to do with OAuth token? Can you inbox me your email address with which you have created the application API with OAuth?

    Kind regards

    -Usman

  • Make a call to REST API through c# to 'change a fixed cost value.

    HI -.

    I am trying to make a call to REST API through c# for "change to a fixed cost value.

    I did successfully the following tasks via c# with the call of the API REMAINS the chargeback manager 2.0

    -Connection to the chargeback manager 2.0

    -Add a custom Chargeback hierarchy

    -Add vCenter Server entity in the hierarchy of Chargeback that was created by the REST API

    -Add the fixed cost model.

    But when I tried to use the REST API to 'change a value of fixed cost' based on the version of the document programming API 2.0.

    He is not successful... Here are the error messages and the code I had.

    Code:

    Public Shared ReadOnly Property ModifiyFixedCost (CookieContainer cookieContainer) as string
    {
    HttpWebRequest request;
    Stream streamReq;
    = request (WebRequest.Create ("https://10.63.11.34/vCenter-CB/api/fixedCost/707/values"); )
    = //request (WebRequest.Create ("https://10.63.11.34/vCenter-CB/api/hierarchy/696/entity/697/costModel/701/fixedCosts/values"); )
    request. CookieContainer = cookieContainer;
    request. Method = "PUT";
    request. KeepAlive = true;
    request. Timeout = 600000;
    request. ContentType = "application/x-www-formulaires-urlencoded; application/x-www-form-urlencoded
    streamReq = request. GetRequestStream();

    Reading XML file.
    String strXML;
    String strCurrentPath = System.IO.Directory.GetCurrentDirectory;
    String strPath = "";
    strPath = strCurrentPath + "\\ModifiyFixedCostXML.txt";

    using (StreamReader sr = new StreamReader (strPath))
    {
    strXML = sr. ReadToEnd();
    }

    String strResp;
    Byte [] byteArray = Encoding.UTF8.GetBytes (strXML);
    streamReq.Write (byteArray, 0, byteArray.Length);
    streamReq.Close ();

    to using (WebResponse response = request. GetResponse())
    {
    Stream streamResp = response. GetResponseStream();
    StreamReader streamReaderResp = new StreamReader (streamResp);
    strResp = streamReaderResp.ReadToEnd ();
    }
    Return strResp;
    }

    XML file:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < application >
    < FixedCosts >
    < FixedCost id = "1" >
    values <>
    < value >
    < cost > 3.14 < / cost >
    < span id = "1" / >
    < / value >
    < / value >
    < / FixedCost >
    < / FixedCosts >
    < / request >

    Error messages;

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < response xmlns =" http://www.VMware.com/vCenter/chargeback/2.0 "" xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance " status = "Failure" > ""

    < majorErrorCode error = '500' minorErrorCode = '0' message = "No such method defined or an API call lack of required arguments. / >

    < / answer >

    Please explain what is the problem here... Is the chargeback REST API c# 2.0 support?

    Thank you

    Yale

    Yale,

    I see the following changes are required in the application:

    1. URL is missing, the startTime and endTime, if the end time is not required to send it as -1. For example: http://localhost: 8080/vCenter-CB/api/fixedCost/553/values? startTime = endTime =-1 & 1340130600000
    2. In XML, fixed cost id must be the same as that mentioned in the URL. XML tag is

    Thank you

    Diomande

  • Fault faultString = CPP &amp; quot; error &amp; quot; faultCode = &amp; quot; Channel.Call.Failed &amp; quot; faultDetail = &amp; quot; NetConnection.Call.Failed: HTTP: failed &amp; quot;

    Hi all

    I am facing this error / fault message for specific conditions of the remote call.
    "Lack of RPC faultString ="error"faultCode ="Channel.Call.Failed"faultDetail =" NetConnection.Call.Failed: HTTP: failed ".

    Note: If the call locally made Remote API, its works well (read the results correctly).
    *********************************************************
    Clerk of result error: [RPC Fault faultString = "error" = "Channel.Call.Failed" faultDetail ="faultCode" NetConnection.Call.Failed: HTTP: failed "]
    to mx.rpc::AbstractInvoker / http://www.adobe.com/2006/flex/mx/internal::faultHandler()
    at mx.rpc::Responder/fault()
    at mx.rpc::AsyncRequest/fault()
    to NetConnectionMessageResponder / channelFaultHandler)
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.messaging.channels::AMFChannel/statusHandler()


    Please suggest any solution / reason for this.

    Thanks in advance!

    Issue seems to be (temporarily) resolve to increase the time-out period for the application server for the duration of the request.
    Permanent solution is optimizing SQLs & reduce response times.

  • Will there be a http api to create a new conversation Hello Firefox?

    A new conversation in Firefox Hello so far can be created by clicking on a button as described here:
    https://support.Mozilla.org/en-us/KB/Firefox-Hello-video-and-voice-conversations-online#w_start-a-conversation

    Y at - it already a http api to create a new conversation? If not: are there plans to create a?
    The api should accept a POST request and reply with the url of the newly created conversation.

    found: https://docs.services.mozilla.com/loop/apis.html#post-rooms
    Please note: docs depict v1, but endpoint https://loop.services.mozilla.com is still running to v0

  • Re-opening a call using the API (v8)

    Hello world

    How can I re - open a call using the API?

    Klebert

    You can always call ExecuteQuery to execute the query "call to reopen it. Then call the CallForwardInt to get to the correct agent / group which will generate notifications.

  • Cannot call a Javascript API of Blackberry to a Web application hosted on a Tomcat server.

    Hi all, I have been using Web work for development. I was able to build a webworks with HTML application, which in turn calls blackberry API using Javascript. However, when I move the HTML to a web application in a tomcat server, and calling the WebApp page from the WebWorks shell with all the permissions granted, I get an error TypeError: cannot convert 'undefined' in an object... Please advice if I am attemping is technically possible, or webworks serves only to write a native application using HTML hosted in blackberry.

    If you host content from a remote domain requiring API access, you need to declare explicitly in the config.

    You will need to create a piece of access as follows:

    http://tx8zdflb30.xxxxx.com:8003" subdomains="true">
    
    
    

    And then you add the elements of functionality for each of the APIs you want than this field/origin to have access to.

  • Call telephone listener API

    Hello

    In my application I have to listen to the incoming and outgoing call as I do some thing on call dtfferent said as callInitiated, call disconnected, CallConnect.

    In Blackberry Java phone abstract class listner is here to get this thing done, how I can achieve it in BB 10?

    I searched this forum and according to this thread

    http://supportforums.BlackBerry.com/T5/Cascades-development/no-phone-calling-and-mailing-from-dev-al...

    Is no such API available before the actual release, is it really the case, I can't build my app before the release of BB 10? can someone help me regard

    Concerning

    Hi BB_Develpoer,

    did you take a glance at this https://developer.blackberry.com/cascades/reference/bb__system__phone__phone.html ?

    No doubt, https://developer.blackberry.com/cascades/reference/bb__system__phone__phone.html#callupdated

    I hope this helps.

  • CPO 3.0 call a REST API

    I try to call a remote REST API that returns a JSON object.

    The call browser API looks like this

    http://IPAM-dev/phpipam/API/?app_id=API&controller=sections&action=read&ID=6

    Returns

    {'success': true, 'data': {'id': '6', 'name': "Telford subnets", 'description': '',' masterSection': '0', 'permissions': "{\"4\":\"1\ ""} strictMode ',' ': '1', 'subnetOrdering': null, 'order': null, "editDate": null, "showVLAN": '0', 'showVRF': '0' "}}

    When I try to use the OPC Web HTTP Request activity it fails with the following error

    Unable to send a content-body with this type of verb.

    I think the problem here is the content type. The default is application/xml; charset = utf - 8 in the activity, I tried to change this text, html and json, but still did not work. I can't let the emty content type in the activity.

    Anyone have any suggestion how to make a REST of CPO call using the activity Web HTTP request

    Try to change GET to POST (in the form of CALL-CPO_REST - RQ.png).  Sends the contents of the body generally requires a POST not a GET.

  • Help with utl_http and https API

    Hi all
    I am trying to write a pl/sql procedure to call the google translate API. I paid for a key and the url itself works without any problem, but I'm fighting to get my call from pl/sql.

    I created a function on my server as suggested by Billy Verreynne here: Re: error on HTTPS using UTL_HTTP

    It was extremely helpful as I can now see the url that goes to google.

    This is the code I use to call the function of Billy is:
    set serveroutput ON
    select * from TABLE(webbrowser('https://www.googleapis.com/language/translate/v2?key=mykeyblahblah&q=Automobile&source=en&target=ja')); 
    (1) my first question: Why am I get invited to enter variable bind by sqldeveloper? These are hard-coded in the url, I'm passing, so I don't know why I get invited to these.

    By Billy function, which is getting sent to google:
    HTTP: GET https://www.googleapis.com/language/translate/v2?key=mykeyblahblahAutomobile=Automobileen=enja=ja
    I'm getting ORA-29268: error the client HTTP 400 - Bad request, obviously from the url get passed to google makes no sense, i.e. the ampersands are get and removed the bind variable I entered replace the names of the parameters.

    (2) so my second question, what am I doing wrong and how can I get the URL to keep signs and identifiers in parameters?

    The first thing that is obvious is that I have a lot to learn here. There seems to be that many tutorials online to UTL_HTTP and even the docs of Oracle are a little sparse.

    For what it's worth my portfolio is ok and the proxy are set that correctly, so I know I'm getting to google, I'm just passing through a bad url.

    This isn't the last function, I'm just trying to take the baby steps so I just call the pl/sql API and retrieve a readable result. If anyone can help point me in the right direction, I would be very grateful.

    If it helps, here's the function I created using the code of Billy:
    create or replace
    function WebBrowser( url varchar2 ) return TStrings pipelined is
    --
    -- BASIC PL/SQL WEB BROWSER TEMPLATE
    -- supports http, https and proxy servers
     
            -- fixed constants
            C_NO_PROXY_FOR  constant varchar2(4000) := 'localhost';
            C_WALLET        constant varchar2(4000) := 'file:/blahblah';
            C_WALLET_PASS   constant varchar2(4000) := 'Welcome';
     
            -- Proxy settings that can be made arguments in the WebBrowser() call
            proxyServer     varchar2(30) := 'www-proxy.com';
            -- not all proxy servers use authentication, but many corporate proxies do, in
            -- which case you need to specify your auth details here
            -- (make it nulls if not applicable)
            proxyUser       varchar2(50) := NULL;
            proxyPass       varchar2(50) := NULL;
     
            -- our local variables
            proxyURL        varchar2(4000);
            request         UTL_HTTP.req;
            response        UTL_HTTP.resp;
            buffer          varchar2(4000);
            endLoop         boolean;
    begin
            -- our "browser" settings
            PIPE ROW( 'Setting browser configuration' );
            UTL_HTTP.set_response_error_check( TRUE );
            UTL_HTTP.set_detailed_excp_support( TRUE );
            UTL_HTTP.set_cookie_support( TRUE );
            UTL_HTTP.set_transfer_timeout( 30 );
            UTL_HTTP.set_follow_redirect( 3 );
            UTL_HTTP.set_persistent_conn_support( TRUE );
     
            -- set wallet for HTTPS access
            PIPE ROW( 'Wallet set to '||C_WALLET );
            UTL_HTTP.set_wallet( C_WALLET, C_WALLET_PASS );
     
            -- configure for proxy access
            if proxyServer is not NULL then
                    PIPE ROW( 'Proxy Server is '||proxyServer );
                    proxyURL := 'http://'||proxyServer;
     
                    if (proxyUser is not NULL) and (proxyPass is not NULL) then
                            proxyURL := REPLACE( proxyURL, 'http://',  'http://'||proxyUser||':'||proxyPass||'@' );
                            PIPE ROW( 'Proxy URL modified to include proxy user name and password' );
                    end if;
     
                    PIPE ROW( 'Proxy URL is '|| REPLACE(proxyURL,proxyPass,'*****') );
                    UTL_HTTP.set_proxy( proxyURL, C_NO_PROXY_FOR );
            end if;
     
            PIPE ROW( 'HTTP: GET '||url );
            request := UTL_HTTP.begin_request( url, 'GET', UTL_HTTP.HTTP_VERSION_1_1 );
     
            -- set HTTP header for the GET
            UTL_HTTP.set_header( request, 'User-Agent', 'Mozilla/4.0 (compatible)' );
     
            -- get response to the GET from web server
            response := UTL_HTTP.get_response( request );
     
            -- pipe the response as rows
            endLoop := false;
            loop
                    exit when endLoop;
     
                    begin
                            UTL_HTTP.read_line( response, buffer, TRUE );
                            if (buffer is not null) and length(buffer)>0 then
                                    PIPE ROW( buffer );
                            end if;
                    exception when UTL_HTTP.END_OF_BODY then
                            endLoop := true;
                    end;
     
            end loop;
            UTL_HTTP.end_response( response );
     
            return;
     
    exception when OTHERS then
            PIPE ROW( SQLERRM );
    end;
    Thank you!
    John

    John K. says:

    (1) my first question: Why am I get invited to enter variable bind by sqldeveloper? These are hard-coded in the url, I'm passing, so I don't know why I get invited to these.

    No bind variable. As bathtubs say these are substitution variables. Something that SQL * more supported for several year and something that is incorporated as a feature of some GUI for Oracle customers.

    Substitution variables are generally used in the installation scripts. You run a script (since SQL * the command-line) and passes command line parameter - these parameters are variables + & 1 + for the parameter 1, + & 2 + for the 2nd, etc..

    The script can then use these in the DDL statements (that do not support the bind variable) - e.g. create user & 1 identified by & 2....

    The customer to DEFINE in SQL command * more active/disable/configure the use of substitution variables. The default character to identify the variable substitution is "+ & +". So your problem with the URL being mutilated by your customer.

    I always use SET DEFINE OFF to disable the calendering customer my sending code on the server for execution. Another option is to use a different character to identify the substitution variables. The installation script Oracle Apex (quite large and quite complex) has the problem of the use of '&' in the code and need to also use substitution variables, as. So the installation uses the "+ ^ + ' character. I suggest to disable the substitution, or affecting a unusual as tank ' ^ ' or ' ~ '.

  • vCenter Orchestrator HTTP API: POST request error 400 1032

    I'm trying to start a workflow via a POST request to the vCenter Orchestrator API. When I run the same workflow with a GET request, there is no problem and I get the following result in the localhost_access_log.current_date.txt:

    [src_ip_address] - [13/Oct / 2015:04:46:00 + 0000] "GET vco/api/flux/af83cf34-6a00-45b5-946e-0d44ece508bb/exécutions/HTTP/1.1" 200 272

    However, when I run a POST with the following parameters:

    restMethod: POST

    restEndpoint: https://[dest_ip_address]:8281

    restPath: / vco/api/workflows/af83cf34 - a 6, 00-45 b 5 - 946e - 0d44ece508bb/executions /

    user: [username]

    content: {"parameters": [{'name': 'name1', 'type': 'string', 'value': {'chain': {"value": "Value1"}}, 'field': 'local'}]}

    contentType: application/json

    accept: application/json

    I have the following error in localhost_access_log.current_date.txt:

    [src_ip_address] - [13/Oct / 2015:03:53:39 + 0000] "POST vco/api/flux/af83cf34-6a00-45b5-946e-0d44ece508bb/exécutions/HTTP/1.1" 400 1032

    And the output on the client side:

    {Success = no, ResponseHeader = {null = HTTP/1.1 400 Bad Request, Server = Apache-Coyote/1.1 Content-Length = 1032, Content-Language = EN, connection = closed, Date-Wed, 13 Oct 2015 Message = Bad Request, ReasonPhrase is Bad Request, StatusCode = 400}}

    I'm in vCenter Orchestrator 5.5. There is no output to the server.log file. I didn't have a chance, researching the 400 1032' error number. [dest_ip_address] is HTTPS. Can anyone help clarify this?

    The command line below seems to work for me using the cmd terminal Windows:

    curl u - ikv name h ' Accept: application/json ' h ' Content-Type: application/json "d" {\"parameters\":[{\"value\":{\"string\":{\"value\":\"value1\"}},\"type\":\"string\",\"name\":\"name1\",\"scope\":\"local\" "}]}" x POST https://ip_address:8281/vco/api / stream/af83cf34-6a00-45b5-946e-0d44ece508bb/executions

    Note that the double quotes inside the body of the request are preceded by the backslash character.

  • Calls via the API

    Hi all

    We are currently working on a web form, we have created a number of calls. Ideally, we would like a call from the parents and a couple of related calls that would be created in the screen through the API.

    Looking the doco, it seems you should be able to use the 'aCustomParameters' field to achieve this. However, I just see KB 2010464, which seems to indicate that it wouldn't quite as simle as this (9.0 in any case).

    I was wondering if someone actually did.

    We're currently on 9.1.5.

    See you soon,.

    Ray

    It's a little weird. Because I did a few tests before posting my previous answers.

    I tried to link two existing calls with two CallUpdate transactions (but not link to CallCreate) and it worked really well.

    Execute transactions of ExecuteQueryAction gave positive results as well.

    So could you explain how you were doing the binding? Your note "creating new calls related appeal existing parent" I guess you do somehow differently.

    Another reason could be the version of the product. I did my tests on 9.2.0. So I guess that it is absolutely possible that something was set inside the API code from 9.1.5.

    Gytis


    Edit: I tried to bind a call at the time where it is created with the CallCreate transaction (also, you need to update parent after that). Works fine as well.

  • Call service HTTPS OSB

    We have a requirement where I need to invoke a HTTPS OSB service... the system gave me 3 certificates...

    I get the error when I call the main service below...

    The invocation was an error: from the certificate chain [Security: 090477]-(servername here) was not trust origin SSL handshake failure...



    Can someone tell me how can I use the 3 certificates provided by the system while calling the business service HTTPS service...



    I created a single certificate file (AllCertificates.cer) with the content of all three certificates provided by the target system. I tried under commond assuming we need import the certificate in jdk so the runtime of osb will check with jkd certificate

    keytool-import - keystore C:\Oracle\Middleware\jdk160_24\jre\lib/security/cacerts-fichier C:\Oracle\Middleware\jdk160_24\jre\bin\mycertificates\AllCertificates.cer



    but I am still experiencing the same error... maybe I do not correctly or need me some conifguration

    Because you have chosen to use the jdk keystore as your trusted keys file, you must change the keystore parameter in the console of administration--> --> tab keystore keystore to define custom identity and Java Standard Trust.

  • !!! Help, please!  Call webservice https in WLS 9.2

    I have a webservice https running in weblogic 9.2. During the call I get {color: #ff0000} < strong > & lt; BEA-090477 & gt; & lt; String certificate received from abcserver.com - 171.186.224.20 was not reliable causing SSL handshake failure. & gt; < facilities >



    {color}



    But when I write a stand-alone program with main() in my local machine and call the webservice work fine! But when I write a client using the same code and put it inside a .war file and deploy in weblogic 9.2 Server and then call,... it gives the error.







    That's what I did.



    1. I have generated the customer using "weblogic.wsee.tools.anttasks.ClientGenTask".



    2 download the .der since firefox after that I accessed the wsld (https://abcserver.com/...wsdl). and created the keystore by < strong > keytool-import - alias servercert - server.der - keystore file server.keystore.



    3 < facilities > added in the client code



    System.setProperty ("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");



    System.setProperty("javax.net.ssl.trustStore",".../server.keystore");



    System.setProperty ("javax.net.ssl.trustStorePassword", "password"); and then called the webservice.







    Funny, it is one with the same code if I write a stand-alone client with public Shared Sub main(), it is able to call the Web service correctly. But if I write the same code and pack it in file .war and deploy in WLS 9.2 it gives the above error. Another thing even if I put "javax.net.ssl.trustStore" with the absolute of the server.keystore folder path, while I printed the values in the jvm, it never shows up. but all the other values are displayed correctly. Is that the main problem is the FMV of my local system and jvm WLS 9.2?



    If someone could help. Please... it's urgent!

    WebLogic uses its own keystore. He's probably ignore these property settings, you need to do. You can see the path to the key file by going to "Servers"--> (server)-> "Settings"-> "Keystore.

  • Country code for international calls to the API

    Hello

    It is possible to get the country code and area code is defined in the option of smart dialing on the BlackBerry API? I use OS 6.0.

    I can get the other locale information such as country and language, but not the County and area code.

    Any idea?

    Thank you.

    These values are not obtained using the API as far as I know.

    I provide it to the application and select the correct one based on the table

Maybe you are looking for

  • Digital telephony for Mac software

    Where can I download the software for Mac OSX 10.5.8 for digital voice recorder Sony ICD-SX750? Thank you.

  • G570 user guide is out of the Office - could not find a site

    I have no idea how or when he left, but the user guide is no more on my desk. I found an area that is suppose to have the pdf file to download, but when I click it it goes to a page that says "File not found." Where can I get the User Guide? Sincerel

  • Windows Firewall/ICS will not start.

    Work on my aunts old Dell Dimension 3000 with XP Home Edition. She had downloaded about 5 to 6 cents free games and the 75g hard drive was full of 97% and I had to boot into safe mode and to sit and to uninstall programs for about 3 hours just to mak

  • IPSec tunnel is disabled

    We have 3 IPSec tunnel set up between the cisco 1760 router and PIX 515e. IPSec tunnel is down by intermittent & son come only after compensation isakmp crypto & clear crypto its next to the router. do we need to configure something else in router an

  • Connection of fabric interconnect with the Cisco MDS switch

    I'm new to the unified fabric and try to understand it. There are clients who connect fabric connects directly to switch MDS without any Nexus 5 K between the two.  If the fabric of interconnections are able to provide connectivity to the LAN and SAN