[PUT] - Update Subscription Job

  • Updated

This API allows you to update the notification subscription in bulk. You can update the notification subscription at any point by adding ids, removing ids, changing startTime, frequency, and any other fields.

This is an Async API. The limit for Bulk Update Subscription is 1 M company Ids.

Endpoint to Create a job

PUT: https://api.insideview.com/api/v1/subscription/job

Request

HTTP Headers

Header Name Type Required Description
accessToken String Yes

Valid access token.
See Authentication and Authorization Overview for more details.

Accept String No Selects the response's content type.  
Valid values are application/json and application/xml (default)

Form Parameters for Updating a Job

Parameter Name Type Required Description
companyIds String No

companyIds to subscribe

addCompanyIds String No

Comma-separated companyId's to add

removeCompanyIds String No

Comma-separated companyId's to remove

peopleIds String No peopleIds to subscribe to. Replaces existing people IDs in the subscription.
addPeopleIds String No Comma-separated list of people IDs to add to the subscription
removePeopleIds String No Comma-separated people IDs to remove
subscriptionId String Yes

Subscription ID

name String No

Name of subscription

description String No

Description of subscription

subscriptionType String Yes

Type of subscription (For example: "company", "companyNews", "people", "companyFamilyTree")

startTime String No

String in ISO 8601 format, e.g., "2015-02-01T00:00:00-8:00"

frequency String No

"7d" (seven days). The "d" in "7d" is critical so that monthly and yearly

For company and people, you can subscribe using the Type if company then ~ pattern is d,w,m,y ( d = day, w = week, m = month and y = year )

For news, you can subscribe using the Type if news then ~ pattern is M,h,d,w ( M = minutes, h=hours, d=day, and w=week )

Validation min 15 minutes is applicable for news only.

field/agents

( if subscription type is company then param is fields, if subscription type is news then param name is agents )

String No

Comma-separated string containing the fields. For example, "Name,SIC,NAICS,companyType"

if subscriptionType = company ( case sensitive )

fields

all(default), Name, ActiveStatus, Revenue, Address, CompanyStatus, CompanyType, FinancialYearEnd, Employees, EmployeeRange, Fax, Naics, Sic, PrimaryIndsutry, Phone, RevenueRange, Ticker, Websites

if subscriptionType = people ( case sensitive )

fields

Valid values:

all (Default), active, name, facebookHandle, linkedInHandle, twitterHandle, education, titles, phone, email, salary, description, imageUrl, age, newEmployment, executiveMobileNo 

if subscriptionType = news ( case sensitive)

agents = ALL, LEADERSHIP_CHANGES, NEW_OFFERINGS, PARTNERSHIPS, COMPANY_PRESENTATION, LITIGATION,

COMPLIANCE, RESEARCH_DEVELOPMENT, DATA_SECURITY, FUNDING_DEVELOPMENTS, BANKRUPTCY_RESTRUCTURING,

REALESTATE_DEALS,REALESTATE_CONSTRUCTION, CORPORATE_CHALLENGES, ACQUISITIONS, EXPANDING_OPERATIONS, COST_CUTTING, OUTPERFORMING, UNDERPERFORMING

cron

String No cron expression for custom frequency settings using Quartz Scheduler Ex. : 0 0 12 * * ? ( For generating alerts at 12 PM everyday). For more use cases, see the Quartz Documentation.
 webhook String No Webhook URL to push the alerts

resultWebhook

String No Push the status of submitted job 

companyStatusV2

String

No

Company status (operating, non-Operating, acquired, liquidating, outOfBusiness, unassigned) 

companyTypeV2

String

No

Company type (public, private, government, organization, unknown)

businessStructure

String

No

The organizational structure of a company (globalParent, uncategorized, subsidiary, group, independent) 

siteCount

String No

Number of company sites

siteLocationCount

String No 

Number of company sites that has site related information

siteTypes

String No

Type of a site

Note: Even if all three of the parameters in the body are marked optional, companyIds must be specified—either one or both of addCompanyIds and removeCompanyIds.

The table below covers all valid and invalid cases:

Combination Validity
companyIds/peopleIds Valid (replaces existing list of Ids)
companyIds/peopleIds, addCompanyIds/addPeopleIds Invalid
companyIds/peopleIds, removeCompanyIds/removePeopleIds Invalid
addCompanyIds/addPeopleIds Valid (duplicates of those already subscribed to are ignored)
removeCompanyIds/removePeopleIds Valid (IDs not in the subscription are ignored)
addCompanyIds/addPeopleIds, removeCompanyIds/removePeopleIds Valid (additions are performed before removals)
companyIds/peopleIds, addCompanyIds/addPeopleIds, removeCompanyId/removePeopleIds Invalid

Responses

HTTP 200

  {
    "jobId":"u259755kvimbu9lo3oq1",
    "status":"accepted",
    "subscriptionId":"3n6ste1l43npouqjb5o",
    "totalProcessed":0,
    "type":"notificationSubscriptionUpdate"
  }

application/xml Example

<BulkModifySubscriptionResponse>
    <jobId>qlagoc98ui99sv8ugkl5</jobId>
    <status>accepted</status>
    <subscriptionId>e45lu7r53achvujk1a2g</subscriptionId>
    <totalProcessed>0</totalProcessed>
    <type>notificationSubscriptionUpdate</type>
</BulkModifySubscriptionResponse>

HTTP Error Codes for Updating job

If Start time is less than current time

{

"errorType": "VALIDATION_ERROR", "status": 400, "message": "Invalid start time, it must be greater than the current time", "diagnosticCode": "fltln8qr0ta3h7vul3ng", "errorNumber": "400-1504" }

If Frequency is invalid

{
   "errorType": "VALIDATION_ERROR",
   "status": 400,
   "message": "Invalid frequency",
   "diagnosticCode": "l7b8alnku4iqfnrqugk",
   "errorNumber": "400-1503"
}

If Subscription type is invalid

{
   "errorType": "VALIDATION_ERROR",
   "status": 400,
   "message": "Invalid Subscription type.",
   "diagnosticCode": "dnaat1r17gut7ppq4rcj",
   "errorNumber": "400-1508"
}