GSD NETframe Sample requests guide


You're able to execute request to net-frame using cURL. cURL is a free, open-source software used to transfer data using Internet Protocols for the given URL. You can execute requests using command line in windows operation system or execute it in your own application. The way of using cURL on your own application, depends on technology which you use to create your app. Below you can see sample requests to net-frame webservice. You can just pass those commands to the command prompt in operation system, set the values and then run.
CURL documentation

/rest/opendocuframedb

First you should open the database. In the response you get the session id, so you will be able to execute more requests

1
curl --insecure -XPOST -H "Content-type:application/json" -d "{\"rashost\":\"yourRemoceAccessServerHost\",\"dbshost\":\"yourDatabaseHost\",\"dbname\":\"yourDatabaseName\",\"username\":\"yourusername\",\"userpwhash\":\"yourpassword\",\"timeout\":3000,\"readtimeout\":3000}" "http://localhost:8080/rest/opendocuframedb"

/rest/executedocuframerequest/{sessionId}

After open database, you've gotten sessionId in the response, so you can execute another requests e.g. get object from the database

1
curl --insecure -XPOST -H "Content-type:application/json" -d "{\"requestname\":\"InterfaceTestMakro\",\"readtimeout\":3000,\"request\":\"{'myInput':'example input'}\"}" "http://localhost:8080/rest/executedocuframerequest/yourSessionID"

rest/close/{sessionId}

When you've finished working with net-frame, you can close your session using below request

1
curl --insecure -XPOST -H "Content-type:application/json" -d "{\"readtimeout\":3000}" "http//localhost:8080/rest/close/yourSessionId"

Axios

Below you can see sample JavaScript code to make a HTTP request using axios library. Axios allow programmer to make a HTTP request both from the browser and node.js application.
Axios documentation

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
const config = { 
    headers: { 'Content-Type': 'application/json' }
};

axios.post('http://localhost:8080/rest/opendocuframedb', { rashost: 'yourRemoteAccessServerHost', dbshost: 'yourDatabaseHost', dbname: 'yourDatabaseName', username: 'yourUserName', userpwhash: 'yourPassword', timeout: 3000, readtimeout: 3000 }, config)
.then(function (response) {
    console.log(response);
})
.catch(function (error) {
    console.log(error);
})
.finally(function () {

});