The CreatorCon Call for Content is officially open! Get started here.

Trying to run a script, authentication problems

hafka
Kilo Explorer

I'm trying script: http://wiki.servicenow.com/index.php?title=Importing_Data_Using_Import_Sets#Perl_Example

Command I run:

uploadafile.pl --url="https://demo00.service-now.com/sys_import.do?sysparm_import_set_tablename=test_import&sysparm_transf..." --uploadfile=c:/data/test_users.csv


However, everytime I try to run this script against demo environment I get error:


Authentication required!

This server could not verify that you are authorized to access the URL "/sys_import.do". You either supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. In case you are allowed to request the document, please check your user-id and password and try again.


Is this the correct way to supply credentials:
# setup basic authentication credentials
$ua->credentials(
'demo00.service-now.com:443',
'ServiceNow',
'admin' => 'admin'
);

I have verified that username is admin and password is admin.


BR,

M

7 REPLIES 7

You get this error when the script cannot reach the URL. Make sure you can ping the url from your test environment. Maybe your test environment requires you go through a proxy?


Ping seems to work ok for our test, development and production environments.

Reply from 37.98.232.100: bytes=32 time=38ms TTL=241

>Maybe your test environment requires you go through a proxy?
How could I make sure that proxy is required in the test environment?
If proxy is used how should I modify the script?


hafka
Kilo Explorer

Problem was the Perl version.
5.16.1.1601 did not work in our instance, but 5.12.4.1205 worked.