Forum

Notifications
Clear all

API

(@ambosis)
Active Member Customer

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

Quote
Topic starter Posted : 08/12/2020 5:20 pm
Achim
(@achim)
Famed Member Customer

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?

ReplyQuote
Posted : 08/12/2020 11:02 pm
(@ambosis)
Active Member Customer

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
 
 

 

ReplyQuote
Topic starter Posted : 09/12/2020 10:02 am
Achim
(@achim)
Famed Member Customer

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.

This post was modified 10 months ago 3 times by Achim
ReplyQuote
Posted : 09/12/2020 9:14 pm
(@ambosis)
Active Member Customer

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

ReplyQuote
Topic starter Posted : 10/12/2020 8:31 am
Achim
(@achim)
Famed Member Customer

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.

 

ReplyQuote
Posted : 10/12/2020 11:28 pm
(@ambosis)
Active Member Customer

Moin Achim,

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

Guten Rutsch!

Heiko

ReplyQuote
Topic starter Posted : 30/12/2020 12:56 pm
Achim
(@achim)
Famed Member Customer

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! 🎆🍾🥂

ReplyQuote
Posted : 31/12/2020 10:58 am
(@ambosis)
Active Member Customer

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

 

ReplyQuote
Topic starter Posted : 03/01/2021 4:41 pm
Achim
(@achim)
Famed Member Customer

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.

ReplyQuote
Posted : 30/03/2021 11:04 pm
(@f1axion)
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.

 

ReplyQuote
Posted : 07/06/2021 9:53 am