Get cookie from header in an API response?

I’m trying to authenticate with an API which uses a POST request of a few fields (user, pass, app version etc). It’s actually working because I get the body back but I can’t seem to be able to access the header which includes the cookie that I need to use for further calls to the API.

Is there a way in Shortcuts to get that header (the get header action doesn’t have any options as to what to POST to the url)?

Or does this have to happen through something like scriptable or pythonista?

1 Like

Correct me if I’m wrong but cookies are stored on your device. They’re not in headers.

Maybe a session token rather than a cookie?

Thank for the replies and sorry for the confusion. I just assumed I can’t use the cookie data in shortcuts any other way. I might be completely wrong but I think I got it to work by fetching it in Pythonista using:
cookie = response.getheader(‘Set-Cookie’)

That gives me the Auth string and expiration info etc. from the response

But I don’t know how to get it back into shortcuts. No idea if I’m over complicating it? I might just try to go the long way around here. It’s an undocumented and unsupported api so that doesn’t make it easier