cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
1219
Views
0
Helpful
4
Replies

Finesse Phone Book Bulk Load

tmiski
Level 1
Level 1

Is there any way to bulk load Finesse Phone Books?

Thanks, Ted

4 Replies 4

James Hawkins
Level 8
Level 8

The Finesse REST API allows you to create and modify phone books.

https://developer.cisco.com/site/finesse/docs/guides/rest-api-dev-guide/

You could write a script in Python or Powershell to use the API to upload phonebook data in CSV format.

Following the API guide, we're running into an issue:

We want to do an automatic import using powershell of a CSV in an existing phonebook in Finesse.

The response weā€™re getting is Bad request (400)ā€¦

 

 

Invoke-WebRequest -Uri https://<FINESSESERVER>/finesse/api/PhoneBook/1/Contacts/csvFileContent -Method post -Credential $cred -InFile test.csv -ContentType "text/CSV"

Invoke-WebRequest : The remote server returned an error: (400) Bad Request.

 

 

Anyone knows what weā€™re doing wrong ?

Thx and kind regards !

I don't know PowerShell very well, but it looks like you need to submit a multipart form data, and not text/CSV.

Look at this for an example:

https://stackoverflow.com/questions/36268925/powershell-invoke-restmethod-multipart-form-data

$FileName = ".\pb.csv"

$Password = ConvertTo-SecureString ā€œpasswordhereā€ -AsPlainText -Force

$Cred = New-Object System.Management.Automation.PSCredential (ā€œusernamehereā€, $password)

 

Obviously, this is not very secure but its simply a proof of concept to do whatever you need;

 

Invoke-WebRequest - uri "https://servername.com:8445/finesse/api/PhoneBook/4/Contacts/csvFileContent" -Method Put -Credential $Cred -InFile $FileName

 

Download Phone Book - (4 being the ID of the phone book)
https://servername.com:8445/finesse/api/PhoneBook/4/Contacts/csvFileContent

if you post, you upload to the above link thats in the Powershell above. 

List specific details for a phone book - (4 being the ID of the phone book)
https://servername.com:8445/finesse/api/PhoneBook/4/

List contacts for specific phone book - (4 being the ID of the phone book)
https://servername.com:8445/finesse/api/PhoneBook/4/Contacts/

 

Ref - http://squirrelsuccess.blogspot.com/2019/11/uccx-phone-books-powershell.html 

Cheers

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: