Rest API

maurizio Tarduc
Tera Contributor

Hello 

using 

curl -s -X POST "%baseurl%/api/now/table/incident?sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_fields=number%2Cshort_description" ^
--header "Accept:application/json" ^
--header "Content-Type:application/json" ^
--data "{\"short_description\":\"Alert from BMCAMI Command Center\",\"description\":\"%T_MESSAGE%\",\"Urgency\":\"%turgency%\"}" ^
--user %user%:%pwd%

 

i receive 

{"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}^C

 

1 ACCEPTED SOLUTION

Hello @maurizio Tarduc 

 

If your password contains special characters (like ^), they might need to be escaped or enclosed in quotes.

Ensure that the password is correctly encoded. Sometimes, special characters can cause issues if not properly encoded.

Verify that the admin user has the necessary roles and permissions to access the REST API. The user should have the rest_api_explorer role or similar.

Check this KB article also

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0812242

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@maurizio Tarduc 

you are passing wrong credentials.

Please check the syntax shared by Viraj and let us know.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader