which works when the tag does not exist yet.
I see the method for data.get which seems to take a "query" parameter; but I haven't been able to make it work with any query I tried, I always got all the tags back; same with the 'search' endpoint.
It should be possible to get the tag from the search endpoint (see python script).
Python script
from joppy.client_api import ClientApi
# Create a new Api instance.
api = ClientApi(token=TOKEN)
# create tag
id_created = api.add_tag(title="abc")
# search for tag
search_results = api.search_all(query="abc", type="tag")
assert len(search_results) == 1
id_searched = search_results[0].id
# verify that the correct tag was found
assert id_created == id_searched
print(id_searched)
# cleanup
api.delete_tag(id_searched)
Something confusing is that the query of the search endpoint is not the search query itself. I.e. the request to the search endpoint should look similar to this pseudocode: path=/search, query={'query': 'abc', 'type': 'tag'}.