Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zuora_apiD

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zuora_apiD

  • 1.6.08
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Zuora Gem

Gem Version coverage report

Installation

Add this line to your application's Gemfile:

gem 'zuora_apiD'

Then execute bundle install in your terminal

Usage

Zuora Login Object

In order to make API calls a Zuora Login object must be created

zuora_client = ZuoraAPI::Login.new(username: "username", password: "password", url: "url")
NameTypeDescriptionExample
usernameAttributeUsername to the Zuora environmentzuora_client.username = "username"
passwordAttributepassword to the Zuora environmentzuora_client.password = "Password"
urlAttributeEndpoint to the Zuora tenantzuora_client.url = "www.zuora.com"
wsdl_numberAttributeWSDL number of the zuora loginwsdl = zuora_client.wsdl_number
statusAttributeStatus of the loginzuora_client.status
current_sessionAttributeCurrent session for the loginzuora_client.current_session
environmentAttributeenvironment of the loginzuora_client.environment
errorsAttributeAny errors that the login has based on the login callzuora_client.errors
current_errorAttributeCurrent error from the new_session callzuora_client.current_error
user_infoAttributeInformation related to the loginzuora_client.user_info
tenant_idAttributeTenant ID the login is associated tozuora_client.tenant_id
tenant_nameAttributeTenant Name of tenant the login is associated tozuora_client.tenant_name
entity_idAttributeCurrent entity the login session is associated tozuora_client.entity_id
rest_callMethodExecutes a REST callzuora_client.rest_call()
soap_callMethodExecutes a SOAP calloutput_xml, input_xml = zuora_client.soap_call() do |xml, args| xml['ns1'].query do xml['ns1'].queryString "select id, name from account" end end
queryMethodExecutes a query callzuora_client.query("select id, name from account")
getDataSourceExportMethodPulls a data source export with the given query and returns the file locationzuora_client.getDataSourceExport("select id, name from account")
describe_callMethodPerforms the describe call against the Zuora tenant for all objects or a specific objectresponse = zuora_client.describe_call("Account")
createJournalRunMethodCreates a Journal Runzuora_client.createJournalRun(call)
checkJRStatusMethodChecks the status of a journal runzuora_client.checkJRStatus(journal_run_id)
update_environmentMethodSets the login's environment based on the urlzuora_client.update_environment
aqua_endpointMethodReturns the AQuA endpoint for the login based off the environmentzuora_client.aqua_endpoint
rest_endpointMethodReturns the REST endpoint for the login based off the environmentzuora_client.rest_endpoint
fileURLMethodReturns the URL for fileszuora_client.fileURL
dateFormatMethodReturns the data format syntax based on the wsdl_numberzuora_client.dateFormat
new_sessionMethodCreate a new sessionzuora_client.new_session
get_sessionMethodReturns the current sessionzuora_client.get_session

Rest Call

zuora_client.rest_call(method: :get, body: {}, url: zuora_client.rest_endpoint("catalog/products?pageSize=4"))

Soap Call

Returns both output and input XML

zuora_client.soap_call(ns1: 'ns1', ns2: 'ns2', batch_size: nil, single_transaction: false)

Example Call

output_xml, input_xml = zuora_client.soap_call() do |xml, args|
 xml['ns1'].query do
  xml['ns1'].queryString "select id, name from account"
 end
end

Query

zuora_client.query("select id from account")

Data Export

Returns the file location of the data source export after downloading from Zuora

zuora_client.getDataSourceExport("select id from account")
NameDescriptionDefaultExample
queryThe query to executeN/Azuora_client.getDataSourceExport("select id from account")
zipIndicates if the data source export should be a ziptruezuora_client.getDataSourceExport("select id from account", zip: false)
extractIndicates if the data source export should be extracted if it is a ziptruezuora_client.getDataSourceExport("select id from account", extract: false)
encryptedIndicates if the data source export should be encryptedfalsezuora_client.getDataSourceExport("select id from account", encrypted: true)

Describe Call

This returns all available objects from the describe call as a hash. This response can be accessed by using response["Account"] to retrieve all related data about that object.

response = zuora_client.describe_call("Account")

This returns all information and fields related to that object model as a hash.

response = zuora_client.describe_call()

Journal Run

zuora_client.createJournalRun(call)

Insights API

In order to make API calls a Zuora Login object must be created by running:

insightsapi = InsightsAPI::Login.new(api_token: "api token", url: "Nw1.api.insights.zuora.com/api/")

Note that the login will default to the insights production url.

Date format: "YYYY-MM-DDT00:00:00Z"

Uploading Data into Insights

insightsapi.upload_into_insights(dataSourceName, recordType, batchDate, filePath)

dataSourceName: What system the data is coming from. recordType: The type of records ie: "EVENTS, ATTRIBUTES, and METRICS" batachDate: The date the data applies to.

Describing Insights Data

insightsapi.describe(type: "ACCOUNT/USER", object: "ATTRIBUTES/EVENTS/SEGMENTS/METRICS")

Returns json payload describing attributes, events, metrics for each Account or User.

Downloading Data from Insights

insightsapi.data_export_insights(objecttype, segmentuuid, startDate: nil, endDate: nil, tries: 30)
insightsapi.data_export_insights_file(objecttype, segmentuuid, startDate: nil, endDate: nil, tries: 30)

Both do the same thing except one returns a url(data_export_insights) to download the file yourself and the other returns an actual Ruby temporary file(data_export_insights_file).

objectype: "ACCOUNT/USER"

segmentuuid: A single or array of string or int of a segment uuid(s) that you get from the describe call. The csv holds a column with a bool that represents if that User or Account belongs to that segment.

FAQs

Package last updated on 27 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc