1
0
-1

I am using the below curl command with a valid sessonid returned from another curl command. However the below command returns a 401 unauthorised error

curl 'https://demo.translate5.net/editor/task?start=0&limit=20' -X GET -H 'Accept: application/json' -H 'Cookie: zfExtended=n6fhg0kpjkekbrsoj470tjvc6s'

{"message":"Unauthorized","errorMessage":"Nicht authentifiziert!","httpStatus":401,"success":false}

Can you let me know what am I missing here?

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi, I think the API calls with sessionid are not provided any more since a few versions. If you use the application token, it will work. But I'm not sure if this is provided with the demo instance.

      Application Token

      Best regards,

      Steven

      1. HrshSameer

        will it be available if I self host Translate5 locally? Also Can you help with any documentation to use Translate5AuthToken in curl commands?

      2. Steven Fischer

        We host Translate5 locally and it is working that way. Maybe you can contact the translate5-support directly if they can provide you a specific testuser with api priviligies.

      3. Steven Fischer

        It is very easy, just add the header mentioned in the documentation like this:

        --header 'Translate5AuthToken: {{Translate5AuthToken}}'
      4. Thomas Lauria

        Hi, indeed our documentation was not up to date. The session based authentication in API calls is not working anymore due security restrictions (CSRF protection). Therefore for API usage the translate5authtoken must be provided. I updated yesterday the API documentation.
        For the generation of tokens see: Application Token

      CommentAdd your comment...