Hello! What is the best way to add a link programmatically? Is there an API? Or I have to first get form token with a first request then do a second request to post my link (with all the cookie correctly set)
I'm pretty sure there's no API. As far as I know, what Android and iOS apps do is what you just described: doing a first request to get the token and then doing a POST request with required parameters.
No, there is no API. That's something we might consider when Shaarli would be entirely refactored, which is a pretty far milestone. I'm not sure how mobile apps works, but yes, probably as @kalvn said ; or something similar.