Jump to content

Add Service With Or Without Provisioning


Recommended Posts

Posted

So the Service.add API doesn't mention if it will provison the service or not.

 

Sometimes I want this and sometimes I don't because I'm adding a service for an already provisioned service.

 

If that API call does not provision the service, how do I do that?

Posted
$ curl -u user:key -X POST -v "http://blestadomain.tk/blesta/index.php/api/services/add.json" -d "pricing_id=1&client_id=2&status=active&DomainName=fu.ga&use_module=false"
{"message":"An unexpected error occured.","response":"Internal error: Failed to retrieve the default value"}

I tried adding a service using the Namecheap module, but I get this error.

 

[edit] ok, I had to use a nested array like vars[password].

 

Am I correct that use_module decides if the domain is provisioned or not?

  • 1 month later...
Posted (edited)
  On 9/16/2013 at 11:21 AM, pepijn said:

ok, I had to use a nested array like vars[password].

 

Any chance you could possibly elaborate on this? A working curl POST command would be great.

 

I can GET data fine, but I'm having great difficulty POST'ing, getting either "failed to retrieve default value" or just an empty HTTP 500 response

 

EDIT

 

I figured it out, you just do something like 

 

$ curl -u user:key -X POST -v "http://blesta.acme.com/users/add.json" -d "vars[username]=test&vars[new_password]=test12&vars[confirm_password]=test12"
Edited by nexu56

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...