I've done something similar to automate phone creation process.
script did something like that:
- start off creating the line or lines needed per phone
- construct the xml soap message
- use a https library to send the a POST request xml data
- wait for a response back from cucm that request was successful
- create the phone object
- construct xml
- use https library to send request
- wait for response back
- if the phone already eixists, send a removePhone request and add phone (personal preference)
- if this is a user phone, send a updateUser request to associate the user with devices
- same as above, construct xml.. etc..
i would recommend spending sometime understanding SOAP and https POST/GET etc
what you're looking to do will mostly use the addPhone, addLine, updateUser objects in axl api.
SOAPUI can be a good way to learn the API requests. it requires no programming, but teaches you the request/response process. this is very helpful before writing any code.
next step is picking a programming language and build a script.
technically, any language can get the job done. but a potentially easier way to get started, is to learn some java, extract the AXL wsdl in eclipse IDE and use the generated code to send requests.
if you need to t-shoot, check axl logs in RTMT. it will show exactly what you are sending CUCM.
hope that helps