How do I upload entities to J1 (quick outline)?
jdowdy
✭✭✭✭✭
I'd like to bulk upload some entities, but it looks like there are multiple steps in the process. Can someone give me a quick outline of what is required?
Headers, sample requests, and endpoints used?
Headers, sample requests, and endpoints used?
0
Answers
-
Hi! Bulk upload is a 2 step process:
- Starting the Synch Job - More info here
- Upload Batch of Entities - More info here
Headers are as follows:Authorization: Bearer {API_TOKEN}
JupiterOne-Account: {YOUR_ACCOUNT_ID}
Content-Type: application/json
---------
Sample Request for "Starting the Synch Job"
Type - POST
Endpoint - https://api.us.jupiterone.io/persister/synchronization/jobs
Headers - provided aboveSample Request Body (raw json):{ "source": "api", "scope": "my-sync-job" }
Sample Response:<br><pre>{ "job": { "source": "api", "scope": "my-sync-job", "id": "f445397d-8491-4a12-806a-04792839abe3", "status": "AWAITING_UPLOADS", "startTimestamp": 1586915139427, "numEntitiesUploaded": 0, "numEntitiesCreated": 0, "numEntitiesUpdated": 0, "numEntitiesDeleted": 0, "numRelationshipsUploaded": 0, "numRelationshipsCreated": 0, "numRelationshipsUpdated": 0, "numRelationshipsDeleted": 0 } }</pre>
^ You'll have anid
returned in the response like the one above. You'll use it in the next step
---------
Sample Request for "Uploading a Batch of Entities"Type - POSTEndpoint - https://api.us.jupiterone.io/persister/synchronization/jobs/{ID_FROM_SYNC_JOB}/entitiesHeaders - provided aboveExample endpoint:
https://api.us.jupiterone.io/persister/synchronization/jobs/f445397d-8491-4a12-806a-04792839abe3/entities
Headers - provided above
Sample Request Body (raw json):{ "entities": [ { "_key": "1", "_type": "fake_entity" }, { "_key": "2", "_type": "fake_entity" }, { "_key": "3", "_type": "fake_entity" } ] }
Sample Response:<pre>{ "job": { "source": "api", "scope": "my-sync-job", "id": "f445397d-8491-4a12-806a-04792839abe3", "status": "AWAITING_UPLOADS", "startTimestamp": 1586915752483, "numEntitiesUploaded": 3, "numEntitiesCreated": 0, "numEntitiesUpdated": 0, "numEntitiesDeleted": 0, "numRelationshipsUploaded": 0, "numRelationshipsCreated": 0, "numRelationshipsUpdated": 0, "numRelationshipsDeleted": 0 } }</pre>
0 -
Thanks! It looks like there is an additional `finalize` step at the end. More information on that here - https://community.askj1.com/kb/articles/794-jupiterone-api#finalize-synchronization-job0
This Month's Leaders
Categories
- 336 All Categories
- Featured Categories
- 7 About the AskJ1 Community
- 11 Product Announcements
- From Mission Control
- 1 Rapid Response
- 3 How J1 Uses J1
- Topics
- 131 Asset Management
- 56 Compliance & Reporting
- 65 Security Operations
- 40 Security Engineering
- 5 Open Source
- 18 News, Careers and More