question

UdeshChathurangaSendanayake-2967 avatar image
0 Votes"
UdeshChathurangaSendanayake-2967 asked LeonLaude edited

SCOM REST API Authentication Error

Hi,

My role is an operator and I'm trying below SCOM login api using postman and i'm getting 401 error. I have followed their official documentation.

POST http://<Servername>/OperationsManager/authenticate


Request is like below :

POST /OperationsManager/authenticate HTTP/1.1
Host: hostname
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: token

{"credentials":"EncodedString(Network:domain\username:password)"}

And also i tried some get calls using browser and those are working.
Someone please assist. Thanks in advance!


msc-operations-manager
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLaude avatar image
0 Votes"
LeonLaude answered LeonLaude edited

Hi @UdeshChathurangaSendanayake-2967,

I wrote a quickstart blog post about SCOM REST API, I suggest you have a look at my examples there:

https://thesystemcenterblog.com/2020/07/09/quick-start-scom-rest-api/

My examples use PowerShell which is a modern but also a great way if you want to start automating.


(If the reply was helpful please don't forget to upvote or accept as answer, thank you)


Best regards,
Leon

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @LeonLaude ,

I have tried your first example to get all new alerts.
Still i'm getting below error.
{"errorMessage":"The user credentials are invalid or user does not have permissions to access the application.}

changes i have made :
$BodyRaw = "AuthenticationMode:domain\username:password" and Host

0 Votes 0 ·
LeonLaude avatar image LeonLaude UdeshChathurangaSendanayake-2967 ·

Your account does not have sufficient permissions, try first with Administrator rights.

0 Votes 0 ·

Thank you for your quick responses.
My role is operator and do you know what is the suitable user role to achieve this? (According to POLP).

I followed below documentation,.
https://docs.microsoft.com/en-us/previous-versions/system-center/system-center-2012-R2/hh872885(v=sc.12)?redirectedfrom=MSDN

0 Votes 0 ·
Show more comments