Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic Aurora Files

 AfterLogic Forum : AfterLogic Aurora Files
Subject Topic: Test and use of WebAPI Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Jannix
Newbie
Newbie


Joined: 19 October 2020
Online Status: Offline
Posts: 8
Posted: 19 October 2020 at 2:27am | IP Logged Quote Jannix

Hi,
I'm interested to use the webAPI to stock and share files through my web app.
I just wanted to try a simple Ping as documented by using Postman and can't even manage to receive a correct answer.
In the documentation this url is provided : https://afterlogic.org/aurora-files?/Api/
but also this one as a test : https://aurora-files.afterlogic.com/?/Api/

Honestly, any input that could help to understand how to work with this webAPI would be nice.

Thanks
Back to Top View Jannix's Profile Search for other posts by Jannix
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6037
Posted: 19 October 2020 at 2:48am | IP Logged Quote Igor

Not sure if I understand what the problem is; the URL is obtained by adding ?/Api/ or index.php?/Api/ to main URL of your Aurora Files installation. A few basic samples are available at: https://afterlogic.com/docs/aurora-files/developers-guide/using-web-api

Also note that Web API isn't something external to the product, Aurora Files itself uses for client-server communication, so you can open your own installation or the live demo at https://aurora-files.afterlogic.com/ - and in browser console, you can check the requests sent, the responses coming from web server, etc.

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
Jannix
Newbie
Newbie


Joined: 19 October 2020
Online Status: Offline
Posts: 8
Posted: 01 November 2020 at 11:46pm | IP Logged Quote Jannix

Thank you for your answer. It actually helped to understand how to install aurora file.
Now that I have everything running (on IIS + MySQL), database setted and all, I still try to send a Ping:
{
      Module: 'Core',
      Method: 'Ping'
}

but now I receive:
{"AuthenticatedUserId":0,"@Time":3.3298,"SubscriptionsResult":null,"@TimeApiInit":3.1756,"@LoggerGuid":"46ae75aa","ErrorCode":103,"Module":""}

I saw that error code 103 stands for invalid data, is invalid what I sent in the body request?

Thanks
Back to Top View Jannix's Profile Search for other posts by Jannix
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6037
Posted: 02 November 2020 at 1:15am | IP Logged Quote Igor

The request actually looks good, we've just performed one ourselves during our Aurora Files demo installation, you can see the screenshot here. We wonder if it would work for you with the live demo at https://aurora-files.afterlogic.com/?

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
Jannix
Newbie
Newbie


Joined: 19 October 2020
Online Status: Offline
Posts: 8
Posted: 02 November 2020 at 2:16am | IP Logged Quote Jannix

I just tried to ping the live demo as you did and the response is good. I received the Pong

I recreated the request from scratch using form-data as you did and I'm able to receive the Pong from localhost \o/
Before I used raw body with JSON formatting because it fits more my front app model as I use HttpClient (in angular):

this.http.post('http://localhost/Aurora/?/Api', {
      Module: 'Core',
      Method: 'Ping'
    }).subscribe(data => {
          console.log('Respond ', data);
        },
        error => {
          console.log('Error', error);
        });

Which doesn't work anyway because of cors issue.
Back to Top View Jannix's Profile Search for other posts by Jannix
 
Jannix
Newbie
Newbie


Joined: 19 October 2020
Online Status: Offline
Posts: 8
Posted: 02 November 2020 at 7:26am | IP Logged Quote Jannix

Alright, so I have been able to get my ping through my app thanks to your answers.

Working with js and NestJS as a backend, I was used to manipulate directly json object in my body resquests. Thank (again) to your answer, I realized that I had to change the body type.
In case any people pass by:

I used URLSearchParams

Sorry, I'm just a beginner but if anyone has a question let me know.
Back to Top View Jannix's Profile Search for other posts by Jannix
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide