Andre Hoefs
Posts: 0
Joined: Fri Jul 25, 2014 8:14 pm

Adding parameters to rest-service-url

Hi,

i'd like to add the values of some storage variables to the url of my rest-Service-url.

How can i do this?

Thank you

hoefsi

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Adding parameters to rest-service-url

Hi Andre -

Do you mean something like this: http://devcenter.appery.io/documentat...

Andre Hoefs
Posts: 0
Joined: Fri Jul 25, 2014 8:14 pm

Adding parameters to rest-service-url

i'm not sure....
how do i get the values of the storage variables into the rest-Settings?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Adding parameters to rest-service-url

Hello Andre,

SETTINGS_NAME.SETTINGS_PROPERTY= Apperty.storage.VARIABLE_NAME.get().PROPERTY_NAME

Andre Hoefs
Posts: 0
Joined: Fri Jul 25, 2014 8:14 pm

Adding parameters to rest-service-url

Hello Evgene,

i tried

Impuls_Rest_Settings.username= Appery.storage.username.get().text;
Impuls_Rest_Settings.passwort= Appery.storage.passwort.get().text;

but it doesn't work?

But maybe there is another way?
I 'd like to add username and passwort to url (calling a php-File) to generate some content for Rest-Service-Call.....

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Adding parameters to rest-service-url

Hi Andre,

Please try following solution:

  1. open your service settings tab. And use {username} and {passwort} in parts of your URL.

    pre

    For example: http://domain.com/{username}/{passwort}/

    /pre

  2. Navigate to "request" tab. And add to "Query String" subtab parameters:
    "username" and "passwort".

  3. Now you can open your datasource and link needed storage to request "username" and "passwort" parameters.

    Regards.

Andre Hoefs
Posts: 0
Joined: Fri Jul 25, 2014 8:14 pm

Adding parameters to rest-service-url

Hello Yurii,

i added username and passwort in the settings-tab:
Image

and added the query strings:
Image

but i can't link the storage:
Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Adding parameters to rest-service-url

Andre,

You opened service response mapping, but you need service request mapping. You could do it in such way:

Open tab "Data" at your screen
Click “Add” to the right of the Before send event field of datasource, and choose “Mapping”

Andre Hoefs
Posts: 0
Joined: Fri Jul 25, 2014 8:14 pm

Adding parameters to rest-service-url

Thank you!
This worked fine! :-)

Andre Hoefs
Posts: 0
Joined: Fri Jul 25, 2014 8:14 pm

Adding parameters to rest-service-url

Unfortunately i get another error:
Everything works fine, if the User filled up the Input Fields "username" and "passwort". But if the fields are blank, i get the following error:

Image

how can i solve this problem?

Return to “Issues”