Error called get request

Community Beginner ,
Apr 02, 2019

Copy link to clipboard

Copied

Hi, I'm trying to send a GET request with Net.HTTP.request to http://dummy.restapiexample.com/ , actually I'm calling this endpoint: http://dummy.restapiexample.com/api/v1/employee/7052

No matter what I try I always get this error:

NotAllowedError: Security settings prevent access to this property or method.

It's a js which is being called at document level, improved security is disabled and I've also tried enabling it.

the code is -->

//<Document-Level>

//<ACRO_source>Init</ACRO_source>

//<ACRO_script>

/**** pertenece a: Document-Level:Init ****/

myTrustedFunction = app.trustedFunction(

    function()

    {

        this.getField("textAJAX").display = display.hidden;

        console.println("2 - ");

        Net.HTTP.request({

            cVerb: 'GET',

            cURL: 'http://dummy.restapiexample.com/api/v1/employee/7052',

            oHandler: {

                response: function(msg, uri, err) {

                    if (err != undefined) {

                        app.alert(msg)

                    } else {

                        console.println("1");

                        var stream = msg;

                        console.println(stream);

                    };

                }

            }

        });

    }

);

//</ACRO_script>

TOPICS
Acrobat SDK and JavaScript, Windows

Views

378

Likes

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

Error called get request

Community Beginner ,
Apr 02, 2019

Copy link to clipboard

Copied

Hi, I'm trying to send a GET request with Net.HTTP.request to http://dummy.restapiexample.com/ , actually I'm calling this endpoint: http://dummy.restapiexample.com/api/v1/employee/7052

No matter what I try I always get this error:

NotAllowedError: Security settings prevent access to this property or method.

It's a js which is being called at document level, improved security is disabled and I've also tried enabling it.

the code is -->

//<Document-Level>

//<ACRO_source>Init</ACRO_source>

//<ACRO_script>

/**** pertenece a: Document-Level:Init ****/

myTrustedFunction = app.trustedFunction(

    function()

    {

        this.getField("textAJAX").display = display.hidden;

        console.println("2 - ");

        Net.HTTP.request({

            cVerb: 'GET',

            cURL: 'http://dummy.restapiexample.com/api/v1/employee/7052',

            oHandler: {

                response: function(msg, uri, err) {

                    if (err != undefined) {

                        app.alert(msg)

                    } else {

                        console.println("1");

                        var stream = msg;

                        console.println(stream);

                    };

                }

            }

        });

    }

);

//</ACRO_script>

TOPICS
Acrobat SDK and JavaScript, Windows

Views

379

Likes

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
Apr 02, 2019 0
Adobe Community Professional ,
Apr 02, 2019

Copy link to clipboard

Copied

This is a privileged operation.  If you want to run it from a document script, then the document has to be trusted. You can do this by marking it as trusted in the "Enhanced Security" Preference, or by digitally certifying it with scripting privileges. Otherwise it has to be done from a trusted function in a folder level script.

Likes

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
Reply
Loading...
Apr 02, 2019 1
Community Beginner ,
Apr 03, 2019

Copy link to clipboard

Copied

Thx, in acrobat is working.

But it doesn't work in Adobe Reader.

The steps were:
"You can do this by marking it as trusted in the "Enhanced Security" Preference"

Code:

Sin título.jpg

myTrustedFunction = app.trustedFunction(

    function()

    {

        var drop= this.getField("dropEmp");

        drop.setItems(new Array([]));

        var employee=[["",""]];

        app.alert("Reader");

        Net.HTTP.request({

            cVerb: 'GET',

            cURL: 'http://dummy.restapiexample.com/api/v1/employees',

            oHandler: {

                response: function(msg, uri, err) {

                    if (err != undefined) {

                        app.alert(msg)

                    } else {                                               

                        var stream = msg;

                        console.println(msg);

                        var string = SOAP.stringFromStream( stream );

                        var json= JSON.parse(string);

                        for (var i = 0; i < 5; i++) {                           

                            employee.push(

                                [

                                    json.id.toString(),

                                    json.id.toString()

                                ]);   

                        }

                       drop.setItems(employee);                        

                    };

                }

            }

        }); 

    }

);

myTrustedFunction();

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 03, 2019

Copy link to clipboard

Copied

You need special forms rights for the use in Acrobat Reader.

Likes

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
Reply
Loading...
Apr 03, 2019 1
Community Beginner ,
Apr 03, 2019

Copy link to clipboard

Copied

Ok, sample? documentation?

I'm a new user.

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 03, 2019

Copy link to clipboard

Copied

In the past it was possible with the product Adobe LiveCycle Reader Extensions. Now it is part of AEM Forms.

Likes

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
Reply
Loading...
Apr 03, 2019 0
Community Beginner ,
Apr 03, 2019

Copy link to clipboard

Copied

Funciones de AEM | Adobe Experience Manager ?

it isn't possible with Adobe Acrobat forms?

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 03, 2019

Copy link to clipboard

Copied

The reader extensions can be applied to Acrobat forms.

Likes

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
Reply
Loading...
Apr 03, 2019 0
Community Beginner ,
Apr 03, 2019

Copy link to clipboard

Copied

Ok, how?

how do I apply the extension?

I don't know

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 03, 2019

Copy link to clipboard

Copied

Do you own AEM?

Likes

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
Reply
Loading...
Apr 03, 2019 0
Community Beginner ,
Apr 03, 2019

Copy link to clipboard

Copied

I only use Adobe Acrobat Pro Dc and Adobe Reader (used by end user)

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 03, 2019

Copy link to clipboard

Copied

It is not possible with Adobe Acrobat.

Likes

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
Reply
Loading...
Apr 03, 2019 0
Community Beginner ,
Apr 03, 2019

Copy link to clipboard

Copied

Forgetting about AEM.

In a created form in Adobe Acrobat, it is impossible to use Net.HTTP.request in Adobe Reader?

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 03, 2019

Copy link to clipboard

Copied

You can use it in Reader when you apply the special form rights to the form!

Likes

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
Reply
Loading...
Apr 03, 2019 0
Community Beginner ,
Apr 03, 2019

Copy link to clipboard

Copied

And how can we do that? Do you know about any documentation explaining the steps to do that?

Thanks

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 03, 2019

Copy link to clipboard

Copied

May be that you can find the information in the documentation of AEM Forms.

Likes

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
Reply
Loading...
Apr 03, 2019 0
Community Beginner ,
Apr 03, 2019

Copy link to clipboard

Copied

We are not using AEM Forms and we cannot use them. We are creating the form using Adobe Acrobat Pro, in which the Net.HTTP.request() call works perfectly, but when we open the form with Adobe Reader this call doesn't work. We have tried to save the form with the following option but it doesn't work neither:

Screenshot_1.png

Any clue about next steps? Thanks!

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 03, 2019

Copy link to clipboard

Copied

Read my replies.

Likes

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
Reply
Loading...
Apr 03, 2019 0
Community Beginner ,
Apr 03, 2019

Copy link to clipboard

Copied

Are you talking about this replies? As I told you we are not using AEM forms and we cannot use them:

Screenshot_2.png

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 03, 2019

Copy link to clipboard

Copied

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 03, 2019

Copy link to clipboard

Copied

There are many different "Rights" or "Reader Extensions" that can be added to a PDF that will allow it to do all kinds of things in Reader. These "Rights" are basically digital certificates.  Some of the most basic "Rights" can be applied with Acrobat Pro. But there are many more, and these requires a special server and have to be purchased (Note: can be insanely expensive). Over the years the name of this server, and exact names and granularity of the rights have changed. These days it's part of the AEM servers. This has nothing to do with AEM forms, its just part of that thing now.

Likes

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
Reply
Loading...
Apr 03, 2019 0
Most Valuable Participant ,
Apr 03, 2019

Copy link to clipboard

Copied

To put it another way, you CANNOT do this in Reader unless you have a budget in the many tens of thousands of dollars. So, instead, you need to buy Acrobat for every single user. That is your choice.

Likes

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
Reply
Loading...
Apr 03, 2019 0
Adobe Community Professional ,
Apr 02, 2019

Copy link to clipboard

Copied

You must use the trusted function in a folder level file.

Likes

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
Reply
Loading...
Apr 02, 2019 1