Cryptlex Forums

API: Sort licenses

C
cartesiam

Hello,

I am trying to sort licenses by expiration date using the API.

When I run https://api.cryptlex.com/v3/licenses?page=1&limit=20&sort=-expiresAt, it works, however the opposite https://api.cryptlex.com/v3/licenses?page=1&limit=20&sort=+expiresAt does not work. I receive a "message": "Invalid sort syntax".

The documentation says sort: string Nullable ([+-]\w*){1}(\|[+-]\w*){0,5}. What should I use ?

Thank you
Regards

A
Adnan KamiliCryptlex team

Hi,

You need to url encode the url as + is not a valid url character. And sorting for expiresAt field may not be available, though we will add this if needed.

Regards,
Adnan

C
cartesiam

Hello,

Indeed, Postman did not the url encoding. So with url encoding, it works great and even with expiredAt field.

Thanks!

← Back to all topics · 3 posts · 1130 views · opened 2020-08-28