Page 1 of 2

Adding parameters to rest-service-url

Posted: Sun Feb 08, 2015 7:06 pm
by Andre Hoefs

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


Adding parameters to rest-service-url

Posted: Sun Feb 08, 2015 9:06 pm
by Illya Stepanov

Hi Andre -

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


Adding parameters to rest-service-url

Posted: Mon Feb 09, 2015 1:00 pm
by Andre Hoefs

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


Adding parameters to rest-service-url

Posted: Mon Feb 09, 2015 4:18 pm
by Evgene Karachevtsev

Hello Andre,

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


Adding parameters to rest-service-url

Posted: Mon Feb 09, 2015 7:33 pm
by Andre Hoefs

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.....


Adding parameters to rest-service-url

Posted: Tue Feb 10, 2015 4:47 am
by Yurii Orishchuk

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.


Adding parameters to rest-service-url

Posted: Wed Feb 11, 2015 12:54 pm
by Andre Hoefs

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


Adding parameters to rest-service-url

Posted: Thu Feb 12, 2015 7:35 pm
by Evgene Karachevtsev

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”


Adding parameters to rest-service-url

Posted: Fri Feb 13, 2015 10:55 am
by Andre Hoefs

Thank you!
This worked fine! :-)


Adding parameters to rest-service-url

Posted: Mon Feb 16, 2015 3:05 pm
by Andre Hoefs

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?