Marketing Preference Batch
home
Marketing Preference Batch
Marketing Preference Batch API to get the CSV file from SFTP server transform into JSON payload and process then post the JSON payload to Salesforce SAPI to feed Salesforce End User Person Account object.
A CSV file with pattern βalerts_librarians_report*.csvβ located in remote SFTP server will be read by this service and transforms the fields to JSON, which is required by Salesforce SAPI endpoints. The records in the file will be either created, updated or goes to exception as per the status of the record in Salesforce.
Architecture Diagram:
Source System
- SFTP server
Target system
- Salesforce
Downstream API
CSV File will Rename as :
alerts_librarians_report.csv_arc -> on successful scenario
alerts_librarians_report.csv_err -> on error or bad data in file scenario
alerts_librarians_report*.csv_bkp -> on connectivity issues scenario
Sequence Diagram:
Sequence Diagram Description:
No. | Steps | Description |
---|---|---|
1. | Searching for new CSV File | Marketing Preference Batch API runs every minute to search new csv file in SFTP location |
2. | New CSV File found | New CSV File found in SFTP, location Marketing Preference Batch API proceed for validation |
3. | Fitter out record with no Email ID, no Last Name | Each record should contained email id and last name for processing the request. |
4. | Create or Update End User Person Account | Marketing preference process API validates if record exist in salesforce, accordingly, sends PUT or POST call to downstream Salesforce system API. |
5. | Feed End User Person Accounts and Journals Articles Data | Salesforce SAPI creates or updates End User Person Account feed. |
6.1 | Success Response Create or Update | Salesforce SAPI responds back to caller API with success details in JSON format |
7.1 | Failure Response Create or Update | Salesforce SAPI responds back to caller API with exception details in JSON format. |
7.2 | POST Data Feed Exception | Salesforce SAPI transform the exception details and feed the details back to Salesforce Data Feed Exception object. |
8. | Return response from Salesforce System API | Returns the success response to marketing preference process API. |
9. | Return response from marketing preference process API | Returns the success response to marketing preference experience API. |
Endpoints:
Get status if Application
- GET: /status
To check the health of the API
This endpoint displays the status of the application in Json format.
Topic | Details | |
---|---|---|
1. | Operation Description | Check the current status of API |
2. | URI | /api/status |
3. | Method | GET |
4. | Response | { "application": "cupa-marketing-preference-xapi-dev", "version": "v1", "environment": "dev", "status": "Running", "timestamp": "2023-02-02T07:41:43.227Z+00:00" } |
5. | Synchronous/Asynchronous | Synchronous |
6. | Protocol | HTTPs |
7. | URL | https://apis-sandbox.cambridgeassessment.org.uk/cupa-marketing-preference-batch-dev/api/status |
8. | Mode of Communication | β Batch β Message β Real Time |
9. | Interface Pattern | β Publish / Subscribe β Request / Reply |