Jump to content

Pass Additional Values In Service Option Urls


AllanD

Recommended Posts

There is some variation of what gets passed in the Service Options Notices in the Universal Module when using a URL

 

For Add there is an "_other" array that contains a client_id and pricing_id.  For others like Suspend only the custom field defined in the service options are passed.

 

The only way I could find to get the expiration date of the service was to use the Blesta API to get all services from the customer id and loop through looking for the item with the custom chat_address field. Chat_address is the only key between the systems.

 

Would it be possible to always pass at least the client_id, service_id in every URL notice?

 

That would create consistency and make pulling other date via the API simpler.

 

Add example ($_REQUEST shown)

http://chatdemo.redhawksoftware.com/api.php?addservice=1
Array
(
    [addservice] => 1
    [website] => www.test9.com
    [chat_address] => test9-com
    [admin_email] => allan@test.com
    [_other] => Array
        (
            [admin_email] => allan@test.com
            [chat_address] => test9-com
            [website] => www.test9.com
            [status] => active
            [use_module] => true
            [pricing_id] => 4
            [qty] => 1
            [current_qty] => 1
            [client_id] => 2
        )
)

Unsuspend example ($_REQUEST shown)

http://chatdemo.redhawksoftware.com/api.php?unsuspend=1
Array
(
    [unsuspend] => 1
    [admin_email] => allan@test.com
    [chat_address] => test6-com
    [website] => www.test6.com) 

 

Link to comment
Share on other sites

i'mnot so familiar with the new API . but i think what you request can be done via the new hooks (available in v3.4) service.add service.suspend service.edit .

in the past i have requested a new feature to add a suspension reasons to the suspended service . with the hooks i have a plugin idea that will allow admins staff to set suspension reason with the hook (service.suspend) .

what i hope it will be ready in v3.4 .

Link to comment
Share on other sites

I am not using the api to update settings in Blesta.  I am using the values Posted from Service Options in another api for a chat service.  The list of values passed from Blesta when posting to a URL is not consistent and it would be very helpful to always pass the _other information (client_id and/or service_id) like when the "Add" post occurs.  This would making looking up corresponding fields (using the Blesta api) simpler and faster.

Link to comment
Share on other sites

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...