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)

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...