# Save Usage Collectors Save Usage Collectors Endpoint: POST /rest/2.0/ACTIVITY_COLLECTOR Version: 1.0 Security: JWT ## Header parameters: - `sessionId` (string, required) ## Request fields (application/json; charset=utf-8): - `brmObjects` (object) - `brmObjects.FtpDataSource` (integer, required) FTP Data Source - `brmObjects.ActivityCollectorName` (string, required) Collector Name - `brmObjects.AccountId` (string) AccountId - `brmObjects.Username` (string, required) Username - `brmObjects.Delimiter` (string) Delimiter - `brmObjects.Created` (string) System controlled field: Date and time the record was created - `brmObjects.FieldIncludedChar` (string) Text Qualifier: Text Qualifier works like the text qualifiers used when importing .CSV files in MS Excel. For example, if the text qualifier character ' (double quote) is used, the system assumes that string of text enclosed in-between these characters is part of a single value. Assuming that the delimiter character configured is a , (comma) the load file below will be treated as having three columns because the text enclosed with ' is treated as one value even if it has a comma in the text. SomeText, 'Easy to understand, I am', AnotherText Without the text qualifier ' (double quote) the text above will be treated as having four columns. - `brmObjects.FtpDirectory` (string, required) FTP Directory: The directory where files will be located. - `brmObjects.FtpFilePattern` (string, required) FTP File Pattern: Only the files that matched the specified pattern will be processed. For example, if the value my_file.*.txt is configured, the collector will look for and process files that use the said pattern on the FTP/remote server. These are some files that could be picked up by the collector with the file pattern from our example: 123my_file.20200807001.txt my_file.1234551.txt - `brmObjects.Status` (string, required) Status: The selected status controls the collector behavior related to the FTP/SFTP setting. In Production Mode, the collector retrieves the files from FTP/SFTP locations. In Test Mode, it does not. - `brmObjects.Hostname` (string, required) FTP Host Name - `brmObjects.FtpLocationType` (string) FTP Location Type - `brmObjects.Type` (string, required) Collector Type - `brmObjects.TimeZoneId` (integer, required) Time Zone: The date in the usage file uses the time zone selected here. - `brmObjects.RecordFormat` (string, required) File Format - `brmObjects.Sproc` (string) Sproc - `brmObjects.AfterProcessDirectory` (string) After Process Directory: This is the directory where processed files are moved to on the FTP/SFTP server. - `brmObjects.PrecollectorValidation` (string) Custom Data Management - `brmObjects.SkipRows` (string) Rows to Skip: System will skip the number of rows from the beginning of the usage file indicated here. This is often necessary to bypass file headers. - `brmObjects.RunIntervalMin` (string) RunIntervalMin - `brmObjects.LastRuntime` (string) LastRuntime - `brmObjects.RateActivityFlag` (string, required) Rate Collected Activity - `brmObjects.LastRowId` (string) LastRowId - `brmObjects.Entity_Id` (string) Entity_Id: Entity Id - `brmObjects.EntityMethod` (string) EntityMethod - `brmObjects.StartDate` (string) StartDate - `brmObjects.Updated` (string) System controlled field: Date and time the record was last updated - `brmObjects.ExternalEntityFieldId` (string) ExternalEntityFieldId - `brmObjects.RetrieveSql` (string) RetrieveSql - `brmObjects.LastRowIdChar` (string) LastRowIdChar - `brmObjects.ServicePointTypeId` (string) ServicePointTypeId - `brmObjects.LoadOrder` (string) LoadOrder - `brmObjects.CreatedUserId` (string) System controlled field: Id of the user that created the record - `brmObjects.UpdatedUserId` (string) System controlled field: Id of the last user that updated the record - `brmObjects.Id` (string, required) Id: Activity Collector id - `brmObjects.LookbackTimePeriodStart` (string) Lookback Time Period Start: Defines when the uniqueness search time period begins. This can be a date or formula - `brmObjects.LookbackTimePeriodEnd` (string) Lookback Time Period End: Defines when the uniqueness search time period ends. This can be a date or formula - `brmObjects.AfterProcessFilePattern` (string) After Process File Pattern: The processed files are renamed based on the specified file pattern. For example, You specified this pattern: *.processed The original file name: sample_2020.txt The new file name: sample_2020.txt.processed - `brmObjects.HostPort` (string, required) FTP Host Port - `brmObjects.OmitEnd` (string) OmitEnd: Omit End Import Records - `brmObjects.ConsolidationMode` (string, required) Usage Consolidation Mode: Collector can operate in 3 modes: In Consolidation Mode, usage can be summarized. For example, sum the attribute across all usage records with the same uniqueness signature or by selecting a record from incoming usage feed to override existing record (rating based on high watermark). In Deduplication Mode, the collector discards records with the same uniqueness signature. In Disable Mode, usage records are always inserted. - `brmObjects.CreateAfterProcessDirectoryFlag` (integer) Create After Process Directory if It Does Not Exist - `brmObjects.AfterProcessAction` (string) AfterProcessAction - `brmObjects.BillableActivityFlag` (string, required) Invoice Collected Activity - `brmObjects.DataSourceId` (integer, required) Data Source - `brmObjects.DataSourceFolder` (string) Data Source Folder - `brmObjects.RejectClosedFlag` (integer) Reject Records Matched to Closed Invoice Periods Events: Consolidation can not happen when an incoming usage record matches a record from a closed invoice. Under such scenario, the incoming usage record can either be marked rejected or added to the next open invoice. When checked the usage records will be rejected and require manual intervention, in the unchecked state the record will be added to the next open invoice. ## Response 200 fields (application/json): - `retrieveResponse` (object) - `retrieveResponse.FtpDataSource` (integer) FTP Data Source - `retrieveResponse.ActivityCollectorName` (string) Collector Name - `retrieveResponse.AccountId` (string) AccountId - `retrieveResponse.Username` (string) Username - `retrieveResponse.Delimiter` (string) Delimiter - `retrieveResponse.Created` (string) System controlled field: Date and time the record was created - `retrieveResponse.FieldIncludedChar` (string) Text Qualifier: Text Qualifier works like the text qualifiers used when importing .CSV files in MS Excel. For example, if the text qualifier character ' (double quote) is used, the system assumes that string of text enclosed in-between these characters is part of a single value. Assuming that the delimiter character configured is a , (comma) the load file below will be treated as having three columns because the text enclosed with ' is treated as one value even if it has a comma in the text. SomeText, 'Easy to understand, I am', AnotherText Without the text qualifier ' (double quote) the text above will be treated as having four columns. - `retrieveResponse.FtpDirectory` (string) FTP Directory: The directory where files will be located. - `retrieveResponse.FtpFilePattern` (string) FTP File Pattern: Only the files that matched the specified pattern will be processed. For example, if the value my_file.*.txt is configured, the collector will look for and process files that use the said pattern on the FTP/remote server. These are some files that could be picked up by the collector with the file pattern from our example: 123my_file.20200807001.txt my_file.1234551.txt - `retrieveResponse.Status` (string) Status: The selected status controls the collector behavior related to the FTP/SFTP setting. In Production Mode, the collector retrieves the files from FTP/SFTP locations. In Test Mode, it does not. - `retrieveResponse.Hostname` (string) FTP Host Name - `retrieveResponse.FtpLocationType` (string) FTP Location Type - `retrieveResponse.Type` (string) Collector Type - `retrieveResponse.TimeZoneId` (integer) Time Zone: The date in the usage file uses the time zone selected here. - `retrieveResponse.RecordFormat` (string) File Format - `retrieveResponse.Sproc` (string) Sproc - `retrieveResponse.AfterProcessDirectory` (string) After Process Directory: This is the directory where processed files are moved to on the FTP/SFTP server. - `retrieveResponse.PrecollectorValidation` (string) Custom Data Management - `retrieveResponse.SkipRows` (string) Rows to Skip: System will skip the number of rows from the beginning of the usage file indicated here. This is often necessary to bypass file headers. - `retrieveResponse.RunIntervalMin` (string) RunIntervalMin - `retrieveResponse.LastRuntime` (string) LastRuntime - `retrieveResponse.RateActivityFlag` (string) Rate Collected Activity - `retrieveResponse.LastRowId` (string) LastRowId - `retrieveResponse.Entity_Id` (string) Entity_Id: Entity Id - `retrieveResponse.EntityMethod` (string) EntityMethod - `retrieveResponse.StartDate` (string) StartDate - `retrieveResponse.Updated` (string) System controlled field: Date and time the record was last updated - `retrieveResponse.ExternalEntityFieldId` (string) ExternalEntityFieldId - `retrieveResponse.RetrieveSql` (string) RetrieveSql - `retrieveResponse.LastRowIdChar` (string) LastRowIdChar - `retrieveResponse.ServicePointTypeId` (string) ServicePointTypeId - `retrieveResponse.LoadOrder` (string) LoadOrder - `retrieveResponse.CreatedUserId` (string) System controlled field: Id of the user that created the record - `retrieveResponse.UpdatedUserId` (string) System controlled field: Id of the last user that updated the record - `retrieveResponse.Id` (string) Id: Activity Collector id - `retrieveResponse.LookbackTimePeriodStart` (string) Lookback Time Period Start: Defines when the uniqueness search time period begins. This can be a date or formula - `retrieveResponse.LookbackTimePeriodEnd` (string) Lookback Time Period End: Defines when the uniqueness search time period ends. This can be a date or formula - `retrieveResponse.AfterProcessFilePattern` (string) After Process File Pattern: The processed files are renamed based on the specified file pattern. For example, You specified this pattern: *.processed The original file name: sample_2020.txt The new file name: sample_2020.txt.processed - `retrieveResponse.HostPort` (string) FTP Host Port - `retrieveResponse.OmitEnd` (string) OmitEnd: Omit End Import Records - `retrieveResponse.ConsolidationMode` (string) Usage Consolidation Mode: Collector can operate in 3 modes: In Consolidation Mode, usage can be summarized. For example, sum the attribute across all usage records with the same uniqueness signature or by selecting a record from incoming usage feed to override existing record (rating based on high watermark). In Deduplication Mode, the collector discards records with the same uniqueness signature. In Disable Mode, usage records are always inserted. - `retrieveResponse.CreateAfterProcessDirectoryFlag` (integer) Create After Process Directory if It Does Not Exist - `retrieveResponse.AfterProcessAction` (string) AfterProcessAction - `retrieveResponse.BillableActivityFlag` (string) Invoice Collected Activity - `retrieveResponse.DataSourceId` (integer) Data Source - `retrieveResponse.DataSourceFolder` (string) Data Source Folder - `retrieveResponse.RejectClosedFlag` (integer) Reject Records Matched to Closed Invoice Periods Events: Consolidation can not happen when an incoming usage record matches a record from a closed invoice. Under such scenario, the incoming usage record can either be marked rejected or added to the next open invoice. When checked the usage records will be rejected and require manual intervention, in the unchecked state the record will be added to the next open invoice. ## Response 400 fields (application/json): - `error` (string) Bad request - `message` (string) Bad request ## Response 401 fields (application/json): - `error` (string) Unauthorized - `message` (string) Unauthorized ## Response 404 fields (application/json): - `error` (string) Not found - `message` (string) Not found ## Response 429 fields (application/json): - `error` (string) Too many requests - `message` (string) Too many requests ## Response 500 fields (application/json): - `error` (string) Internal error - `message` (string) Internal error