Start a Conversation

Unsolved

Closed

R

2 Posts

527

March 16th, 2023 11:00

WMS API on prem generic 500 error

 

I have searched and searched and also reached out to Dell support to which they claim that API is a third party tool and under warranty is only covered for minimal support. Using their documentation and some info from the user communities, I have tried using POSTMan and powershell. 

Below is the powershell sample I have tried.

$username = "XXXXXXXXX"
$password = "XXXXXXXXXXXXXX"
$authURI = "https://us1.wysemanagementsuite.com:443/wms-api/wms/v1/SessionService/Sessions"

$body = @{    
    UserName  = $username
    Password  = $password
}

$token = Invoke-WebRequest -Method POST -Uri $authURI -Headers @{"accept"="application/json"} -Body ($body | ConvertTo-Json) -ContentType 'application/json'
$XAuthToken =  $token.Headers.'X-Auth-Token'

Below is the sample I am using from the Dell documentation hosted here: Get the X-Auth-Token | Dell Wyse Management Suite API | Dell Technologies Developer

Open the Postman application.
Select the request type as POST.
Enter https://{Server host name or IP}:443/wms-api/wms/v1/SessionService/Sessions.
Go to the Body tab and select raw.
Select JSON.
Enter the username and password in the JSON format. For example,
{ "UserName" : "admin@dell.com", "Password" : "Wyse#123" }
7. Click Send.

The "Pretty" message says:

 "message": "A general error has occurred. See Resolution for information on how to resolve the error."

Looking at the resolution, it says to contact Dell Support.

Any help would be appreciated.

Thanks in advance.

1 Message

March 21st, 2023 09:00

If you are using postman client to connect to API, then you must include Accept = */* in the header.

https://developer.dell.com/apis/3788/versions/3.8/docs/Getting%20Started/1Prerequisites.md

 

my PS-Script:

# Dell Wyse Login
if(!$credAPI){$credAPI = Get-Credential -Message "a 'Global Administrator' Account from Wyse Management Suite required"}


$BaseURL = "https://eu1.wysemanagementsuite.com/wms-api/wms/v1"
$LoginUri = $BaseURL+"/SessionService/Sessions"

$headerJSON = @{ "content-type" = "application/json";odata="verbose";Accept="*/*"}

$username = $credAPI.UserName
$password = $credAPI.GetNetworkCredential().password
$credBody = @{UserName = $username; Password=$password} | ConvertTo-Json
$session = Invoke-WebRequest -Uri $LoginUri -Method Post -Body $credBody -Headers $headerJSON

$authHeader = @{'X-Auth-Token' = $($session.Headers.'X-Auth-Token')}

# Systems
$headerJSON = @{ "content-type" = "application/json";Accept="*/*"}
$Header = $authHeader+$headerJSON 

$RequestURI = "$BaseURL/Systems"
$RequestResult = Invoke-WebRequest -Uri $RequestURI -Method Get -Headers $Header 
$RequestResult.Content

 

 

2 Posts

March 21st, 2023 10:00

The POSTMan app has that header auto checked so it is already enabled. Contacting Dell support lead nowhere which is why I am here. At present time, I am simply trying to get the Auth-Token.

No Events found!

Top