I am new to PHP and Apache. I have been trying to understand the code and how the framework works, but just can't figure it out how to make the API call yet.
What I want to do is to use Java or .NET to do the API operation becuase those are the main languages of our team.
I have set alias 'seeddms' in Apache for the root of the application, so a home page visit is http://localhost/seeddms
In .NET using RestSharp you can make the API call with the following code
varclient=newRestClient(@"http://localhost/seeddms/restapi/index.php");client.CookieContainer=newSystem.Net.CookieContainer();// Cookie Managment für Login//Maybe you must Login before some API calls, use same client object, for cookie managmentvarrequest=newRestRequest(string.Format("/document/{0}",document_id),RestSharp.Method.GET);request.AddHeader("Accept","application/json");// execute the requestIRestResponseresponse=client.Execute(request);varcontent=response.Content;// raw content as string
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i've tried to open http://localhost:8080/seeddms/restapi/login from the browser - its showing the text box for entering username and password after entering the username and password it returns {"success":true,"message":"","data":"1"} . I dont know how to proceed further with other API calls. can anybody explain how to call the create folder method - im trying to open a specfic folder in seeddms from my java application. please help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How to get cookie information when calling login REST call and pass it to call other REST url ? I'm trying from JAVA application. while calling the Login rest service - its returing the json value. I dont know how to pass that info for calling other REST service
Last edit: Manikandarajan 2016-12-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to redirect my java application to seeddms dashboard after some REST calls. while opening the seeddms dashboard it shows login screen, is there any way can we bypass the user login to open seeddms dashboard in the browser.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Try to make get request in your browser. It works for me on 5.0.8 version
http://[server]:[port]/op/op.Login.php?login=User1&pwd=Pass1234&referuri=/out/out.AdminTools.php
(referuri parameter is optional).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can anyone share the url pattern for create folder REST api call, I've tried
http://[server]:[port]/seeddms/restapi/index.php/folder/[foldername]/createfolder
but it returns success without folder id and the folder is not created.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Phaser Fill, VERY MUCH THANKS for your hint. i've tried with your settings. but getting 500 response code. please find below code and advice me where i've made the mistake. if i give the folder id which is not available instead of 4 anyother value - im getting {"success":false,"message":"","data":""} .. but i'm trying to create folder under the folderid 4.
Hi,
I am new to PHP and Apache. I have been trying to understand the code and how the framework works, but just can't figure it out how to make the API call yet.
What I want to do is to use Java or .NET to do the API operation becuase those are the main languages of our team.
I have set alias 'seeddms' in Apache for the root of the application, so a home page visit is
http://localhost/seeddms
What is the URL of the REST API? I have tried the following, but all return a 404 error. I am trying these based on the routing statements in restapi\index.php.
http://localhost/seeddms/document/1
http://localhost/seeddms/restapi/document/1
This is my Apache setting:
In .NET using RestSharp you can make the API call with the following code
Is there any sample code for JAVA or any documentation available ?
i've tried to open http://localhost:8080/seeddms/restapi/login from the browser - its showing the text box for entering username and password after entering the username and password it returns {"success":true,"message":"","data":"1"} . I dont know how to proceed further with other API calls. can anybody explain how to call the create folder method - im trying to open a specfic folder in seeddms from my java application. please help
How to get cookie information when calling login REST call and pass it to call other REST url ? I'm trying from JAVA application. while calling the Login rest service - its returing the json value. I dont know how to pass that info for calling other REST service
Last edit: Manikandarajan 2016-12-29
Hi, In java i've preserved the login cookie and send that along with the other REST call - it works fine
I'm trying to redirect my java application to seeddms dashboard after some REST calls. while opening the seeddms dashboard it shows login screen, is there any way can we bypass the user login to open seeddms dashboard in the browser.
Try to make get request in your browser. It works for me on 5.0.8 version
http://[server]:[port]/op/op.Login.php?login=User1&pwd=Pass1234&referuri=/out/out.AdminTools.php
(referuri parameter is optional).
Thanks for the reply, I've tried with my 4.3.13 and its not working, let me change the version and update the status.
Can anyone share the url pattern for create folder REST api call, I've tried
http://[server]:[port]/seeddms/restapi/index.php/folder/[foldername]/createfolder
but it returns success without folder id and the folder is not created.
You should send folderID instead foldername
POST http://[server]:[port]/restapi/index.php/folder/[id of parent folder]/createfolder HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
Cookie: mydms_session=[your session id]
Content-Length: 16
Host: [server]:[port]
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
name=[name of new folder]
Last edit: Phaser Fill 2016-12-30
Hi Phaser Fill, VERY MUCH THANKS for your hint. i've tried with your settings. but getting 500 response code. please find below code and advice me where i've made the mistake. if i give the folder id which is not available instead of 4 anyother value - im getting {"success":false,"message":"","data":""} .. but i'm trying to create folder under the folderid 4.
apache log: 10.44.13.152 - - [30/Dec/2016:15:23:17 +0530] "POST /seeddms/restapi/index.php/folder/4/createfolder HTTP/1.1" 500 1486
String url = "http://10.44.13.152:8080/seeddms/restapi/index.php/folder/4/createfolder";
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
Last edit: Manikandarajan 2016-12-30
Hi!
con.setRequestProperty("Accept-Encoding", "gzip,deflate");
con.setRequestProperty("Content-Length","16");
con.setRequestProperty("Host","http://10.44.13.152:8080");
con.setRequestProperty("Connection","Keep-Alive");
con.setRequestProperty("User-Agent", "Apache-HttpClient/4.1.1 (java 1.5)");
Thank you very much Phaser Fill , I'm trying with different combinations of setRequestProperty and share the info if it started working.