Skip to content

Instantly share code, notes, and snippets.

@Sdy603
Sdy603 / fetch_jira_incidents_and_POST_incidents_API.js
Last active September 25, 2024 19:54 — forked from ivansnag/fetch_jira_incidents_and_POST_incidents_API.js
Fetches JIRA incidents from DB and POSTs to the Incidents API
const { Client } = require('pg');
const axios = require('axios');
// Set debug mode
const debug = true; // Set to false to make actual API calls
// Database connection string
const connectionString = [CONNECTION STRING FROM DX]
// Create a new PostgreSQL client
const fetch = require('node-fetch');
const fs = require('fs');
const csv = require('csv-parser');
const csvFilePath = 'CSV TEMPLATE';
const apiEndpoint = 'CUSTOMER SPECIFIC INCIDENTS SYNC ENDPOINT';
const apiKey = 'API KEY';
fs.createReadStream(csvFilePath)
@Sdy603
Sdy603 / test_event
Created August 7, 2024 16:15 — forked from ivansnag/test_event
Test Event for PlatformX
curl https://api.getdx.com/events.track -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <api key here>" \
-d '{"name": "your.event", "email": "[email protected]", "timestamp":"1680723287" }'