REST API knowledge exchange
rwgustason
Novice
Posts: 9 Liked: 3 times
Joined: Aug 13, 2019 1:22 pm
Full Name: Ryan Gustason
Contact:
Post
by rwgustason » Apr 15, 2021 3:20 pm
this post
I am trying to send a DELETE to close my API session in a script using curl on a Linux server. Here's the command:
Code: Select all
curl -X DELETE -k https://enterprisemanager:9398/api/logonSessions/*****sessionidstring*******
When I run that command I get:
Code: Select all
{"FirstChanceExceptionMessage":null,"StackTrace":null,"Message":"Identity was not authenticated.","StatusCode":401,"Status":"Unauthorized"}
I think I need a 204 return according to the documentation but I don't know what is wrong with my syntax to properly close my Enterprise Manager API session.
Any thoughts?
rwgustason
Novice
Posts: 9 Liked: 3 times
Joined: Aug 13, 2019 1:22 pm
Full Name: Ryan Gustason
Contact:
Post
by rwgustason » Apr 15, 2021 3:28 pm
2 people like this post
Nevermind, I found an answer.
Code: Select all
curl -X DELETE -v -k https://enterprisemanager:9398/api/logonSessions/*****sessionid*********** -H "X-RestSvcSessionId: *****X-RestSvcSessionId******"
Returns:
Code: Select all
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 204
< server: Microsoft-HTTPAPI/2.0
Users browsing this forum: No registered users and 1 guest