<% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>

blib::lib::FS::part_export::sipwise

get_customer SERVICE

Returns the Sipwise customer record that should belong to SERVICE. This is based on the pkgnum field.

find_or_create_domain DOMAIN

Returns the record for the domain object named DOMAIN. If necessary, will create it first.

acct_for_did SVC_PHONE

Returns the subscriber svc_acct linked to SVC_PHONE.

export_did NEW, OLD

Refreshes the subscriber information for the service the DID was linked to previously, and the one it's linked to now.

get_subscriber SVC

Gets the subscriber record for SVC, if there is one.

import_cdrs START, END

Retrieves CDRs for calls in the date range from START to END and inserts them as a CDR batch. On success, returns a new cdr_batch object. On failure, returns an error message. If there are no new CDRs, returns nothing.

api_query RESOURCE, CONTENT

Makes a GET request to RESOURCE, the name of a resource type (like 'customers'), with query parameters in CONTENT, unpacks the embedded search results, and returns them as a list.

Sipwise ignores invalid query parameters rather than throwing an error, so if the parameters are misspelled or make no sense for this type of query, it will probably return all of the objects.

api_create RESOURCE, CONTENT

Makes a POST request to RESOURCE, the name of a resource type (like 'customers'), to create a new object of that type. CONTENT must be a hashref of the object's fields.

On success, will then fetch and return the newly created object. On failure, will throw the "message" parameter from the request as an exception.

api_update ENDPOINT, CONTENT

Makes a PUT request to ENDPOINT, the name of a specific record (like 'customers/11'), to replace it with the data in CONTENT (a hashref of the object's fields). On failure, will throw an exception. On success, returns nothing.

api_delete ENDPOINT

Makes a DELETE request to ENDPOINT. On failure, will throw an exception.

api_request METHOD, ENDPOINT, CONTENT

Makes a REST request with HTTP method METHOD, to path ENDPOINT, with content CONTENT. If METHOD is GET, the content can be an arrayref or hashref to append as the query argument. If it's POST or PUT, the content will be JSON-serialized and sent as the request body. If it's DELETE, content will be ignored.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 169:

'=item' outside of any '=over'

=over without closing =back

<% include ('/elements/footer.html' ) %>