createservice API is available fo this.
Download sample from www.vbadmincode.com
and go through it.