• Stephen Loughin
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I can read using bulk.create_query_job, but I can't write back to Product2 with bulk.create_insert_job
bulk = SalesforceBulk(sessionId=self.access_token, host=urlparse(self.instance_url).hostname) 
job = bulk.create_insert_job(object, contentType='CSV')  # fails on this line
reader = csv.DictReader(open(csv_file)) 
items = [] 
for row in reader: 
   items.append(row) 
csv_iter = CsvDictsAdapter(iter(items)) 
batch = bulk.post_bulk_batch(job, csv_iter) 
bulk.wait_for_batch(job, batch) 
bulk.close_job(job)


The object I'm passing is 'Product2' and I can use the same SalesforceBulk object to successfully perform a bulk query on Product2 using bulk.create_query_job.  This code fails on create_insert_job with the following response:
[400] Bulk API HTTP Error: InvalidJob - No create access for object:Product2
Is this a permissions issue?  I am using an admin account.
I know there are some docs where its explained that but.
I have a csv for an custom object with 10000 records.
I want to upload this data to my org using bulk api.
I know there are tools are dataloader.io and apex data loader. but i want it as custom tool in python.
Thanks.