Hi there,
I’m exploring the API to add assets to Anthias.
For now, I’ve been able to GET and DELETE and PATCH assets (e.g. flipping the ‘is_enabled’ boolean) through Python’s requests library and/or Postman, but am unable to truly add an asset.
When I try with following POST call:
{“name”: “test123”, “mimetype”: “webpage”, “uri”: “http://www.google.com”, “is_enabled”: “0”}
I get:
{“error”: “Not enough information provided. Please specify ‘name’, ‘uri’, ‘mimetype’, ‘is_enabled’, ‘start_date’ and ‘end_date’.”}
OK, so let’s provide start/end date:
{“name”: “test123”, “mimetype”: “webpage”, “uri”: “http://www.google.com”, “is_enabled”: “0”, “start_date”: “2017-02-02T00:33:00.000”, “end_date”: “2025-02-02T00:33:00.000”}
However that yields:
{“error”: “invalid literal for int() with base 10: ‘’”}
I assume this has to do with the datetime format I’m posting. What kind of format is expected for start/end date?
The format above is the one I got from the swagger example.
I tried with various other formats such as “2023-04-10T18:50:00+00:00”, “04/10/2023 22:24:00” (shown on the web page), epoch “1681372113”, and few more.
Any pointer on this? Thanks!