Forum

Notifications
Clear all

API

14 Posts
3 Users
0 Likes
1,732 Views
(@ambosis)
Posts: 7
Active Member
Topic starter
 

Hy admins,

I would like to ask whether there is an API for adding SteamIDs and for triggering the initialization after an FTP upload? It would be nice if I didn't have to log into the web frontend to do this, especially since it cannot be automated.

Best regards from Kiel

 
Posted : 08/12/2020 6:20 pm
Achim Ennenbach
(@achim)
Posts: 3797
SimSync PRO Developer Admin
 

Hey Ambosis,
currently, no API can be used to update the series properties like SteamIDs and so on, or run commands like indexing a series or whatever might be useful.
But that we don't have a public API, doesn't mean that we are not willing to add something like this.
First, we need more information:

  • How do you want to access the API?
  • Is it only what you mentioned, to change the SteamIDs and to run the Indexer?
  • What do you mean by "since it cannot be automated"?

What is so "time-consuming" to use the WebSync website instead of an API? OK, in the case of SteamIDs I can imagine, that some kind of API has benefits. But what would be the benefit in the case of the indexer? Do you want to automatically start the indexer once the FTP Client has finished uploading?

 
Posted : 09/12/2020 12:02 am
(@ambosis)
Posts: 7
Active Member
Topic starter
 

Hello Achim,

first I want to briefly report why I have an automation. We're a small group of SimRacers who don't run big leagues - small and fine. We have a platform where members can start races independently.

If a new racer comes along and registers in our system, I have to add it within seconds with his SteamID for SimSync, because otherwise he'll be grumbling: doesn't work!

Or a skin is uploaded in our skin management system (packing all of the uploaded skin files into one content zip file). Then the change has to be made on the FTP server at SimSync at very short notice. I can automate the upload. But I cannot say that SimSync takes the addition into account. I have to index  via the website manually.

Idea for a solution:

a) removed link ;SimSync-API-ID>&command=AddSteam&data=<SteamID>

b) removed link ;SimSync-API-ID>&command=index

* SimSync-API-ID is a combination of username and password to a special key like your ConfigKey but without special characters

 
The next big thing could be uploading a zip file that will unzip your system. Transferring a large number of individual files via FTP is not very effective.
 
I am curious if you like the ideas. 🙂
 
Best regards
Heiko
 
 

 

 
Posted : 09/12/2020 11:02 am
Achim Ennenbach
(@achim)
Posts: 3797
SimSync PRO Developer Admin
 

Hi Heiko,

First of all, I'll put the API topic on the agenda for the WebSync. Not sure when this will become available, because the current priority is on finishing the next SimSync PRO version and releasing it before Christmas.

But i have already some ideas on how to implement the API into the WebSync and that's always a good sign. 😀 😉 

I hope you will be able to access the API via http(s) and to send any values or commands via POST and not only via GET. The transferred data should also be prepared and signed in a way that makes sure that it comes from you and not from a 3rd-party and that it wasn't changed during transfer.

What I did not understand 100% is the topic regarding a zip file of all your skins and why this should have an advantage. But maybe this is because you and me are germans trying to explain it to each other in english... 😆 😆 😆 

Also ich hätte nix dagegen das in Deutsch zu klären... 👍  

Allen anderen Interessierten empfehle ich https://DeepL.com als den besten Ãœbersetzer den ich kenne.

 
Posted : 09/12/2020 10:14 pm
(@ambosis)
Posts: 7
Active Member
Topic starter
 

Hallo Achim,

über den letzten Absatz habe ich nun Tränen gelacht. 🤣 

POST: wunderbar 🙂

ZIP-File: die Idee war, dass man größere Uploads per Zip-File macht und Euer System das ZIP entpackt. Bei einer hohen Zahl an (kleinen) Files ist das denke ich ressourcenschonender

Gruß Heiko

 
Posted : 10/12/2020 9:31 am
Achim Ennenbach
(@achim)
Posts: 3797
SimSync PRO Developer Admin
 

Ach, ein vernünftiger FTP Client ist in der Lage gleich mehrere Dateien auf einmal hochzuladen. Und ausserdem hat man dann wenigstens mal Zeit mehr als 1x am Kaffee zu nippen. ☕
Klar, entpacken des Zip File auf dem Server wäre natürlich möglich, aber ich würde da eigentlich gerne aus Sicherheitsgründen drauf verzichten.

 

 
Posted : 11/12/2020 12:28 am
(@ambosis)
Posts: 7
Active Member
Topic starter
 

Moin Achim,

konntest Du zufällig die Verdauungsstarre der letzten 3 Tage vorm Rechner nutzen, um API-Requests zu ermöglichen? 🙂

Guten Rutsch!

Heiko

 
Posted : 30/12/2020 1:56 pm
Achim Ennenbach
(@achim)
Posts: 3797
SimSync PRO Developer Admin
 

Moin Heiko,
ein gewisses Grundgerüst habe ich bereits, aber ich werde jetzt erst richtig mit den Arbeiten an der API beginnen. Jetzt, nachdem der neuen Sync veröffentlicht ist, habe ich endlich die Zeit mich der API widmen. Ich denke, es dürfte jetzt nicht mehr allzulange dauern, bis wir die ersten Tests machen können. Sobald ich da was zu testen habe, melde ich mich.

Eine Frage noch so am Rande... Wirst du die API mit PHP abfragen, bzw. "bedienen"?

Bis dahin, einen guten, unfallfreien Rutsch ins neue Jahr und alles Gute für 2021! 🎆🍾🥂

 
Posted : 31/12/2020 11:58 am
(@ambosis)
Posts: 7
Active Member
Topic starter
 

Moin Achim,

frohes Neues Jahr. .-)

Ich progge in Perl. Ist aber egal. Ich brauche nur die Parameter und los geht es. 🙂

Viel Erfolg.

Gruß Heiko

 

 
Posted : 03/01/2021 5:41 pm
Achim Ennenbach
(@achim)
Posts: 3797
SimSync PRO Developer Admin
 

Wer hat an der Uhr gedreht, ist es wirklich schon so spät...

Oh Mann... Echt schon 3 Monate her?!??
Ich bin jetzt so langsam in den letzten Zügen. d.h. Die Api funktioniert grundsätzlich schonmal und ich werde jetzt damit beginnen eine Doku dafür zu schreiben.

 
Posted : 30/03/2021 11:04 pm
(@f1axion)
Posts: 6
Active Member
 

@ambosis You can automate logging-in to WebSync using Python's Selenium I guess. It is as visiting the website yourself but the click on buttons and adding credentials to the website can be automated.

So you could make a script that reads a file where you have your SteamID of your users,detect a change to that file and trigger the auto-add to the WebSync List. The same goes for triggering auto-ftp but you have already done that.

This is like a 'Watchdog application'. 

https://pypi.org/project/watchdog/

https://selenium-python.readthedocs.io/installation.html#introduction

 

Now if you just want to automate only the indexing then a simple selenium script will do the trick.

As you have already have a script i guess to upload the ftp files to the server then you can trigger another function after the upload, (a selenium function if it is on python) inside the current script you run.

Or you can have the one script to auto-upload and the other just to auto-visit and auto-index via WebSync.

This of course is a temporary solution. API would be much more easy to use.

 

 
Posted : 07/06/2021 9:53 am
(@ambosis)
Posts: 7
Active Member
Topic starter
 

Hy @f1axion 

cool solution, but I think I ask achim for an api solution 😉

Thanks Heiko

 
Posted : 24/10/2021 5:44 pm
(@ambosis)
Posts: 7
Active Member
Topic starter
 

Hallo @achim 

ich wieder - unsere SimRacing-Saison startet wieder. 😉 Jaja, im Sommer ist bei uns immer Flaute.

Hast Du nun ne Möglichkeit, dass ich den Sync per API anstoßen kann?

Ich bin auch gerne Beta-Tester. 🙂

Gruß Heiko

 
Posted : 24/10/2021 5:45 pm
Achim Ennenbach
(@achim)
Posts: 3797
SimSync PRO Developer Admin
 

Hast 'ne Email ... 😉

 
Posted : 29/11/2021 2:01 pm