• Ethan Han
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies

According to the API documentation:

https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_xml_rel_fields.htm

the it should be able to make relationship between objects but when I followed the instruction, I get an error below:

[
{
"success": false,
"created": false,
"id": null,
"errors": [
{
"message": "Unexpected JsonMappingException: Cannot deserialize instance of reference from START_OBJECT value { or request may be missing a required field\n at [Source: java.util.zip.GZIPInputStream@5889e6b8; line: 4, column: 26]",
"fields": [],
"statusCode": "INVALID_FIELD",
"extendedErrorDetails": null
}
]
},
{
"success": false,
"created": false,
"id": null,
"errors": [
{
"message": "Json Deserialization failed on token 'Author_ID__c' and has left off in the middle of parsing a row. Will go to end of row to begin parsing the next row",
"fields": [
"Author_ID__c"
],
"statusCode": "INVALID_FIELD",
"extendedErrorDetails": null
}
]
}
]


request url:
https://myinstance--sandbox1.my.salesforce.com/services/async/44.0/job/batch_id/batch

request body:
[
    {
        "Name":"Test Title",
        "Contributor_lookup__c":{"Author_ID__c":"test-user-id"}
    }
]
I'm hoping anyone here can help me what I'm doing wrong.
Thank!
Hi, I'm trying to import csv data by using Bulk API 2.0 
I was able to created a job:

url: 
https://myinstance.my.salesforce.com/services/data/v44.0/jobs/ingest
headers: 
Content-Type:application/json; charset=UTF-8
Authorization:session_id
Accept:application/json
body:
{
    "contentType" : "CSV",
    "object" : "Title__c",
    "operation" : "insert",
    "lineEnding": "CRLF"
}

and I was trying to do a test run for adding batch to a job with dummy csv content.

url:
https://myinstance.my.salesforce.com/services/data/v44.0/jobs/ingest/job_id/batches
headers:
Content-Type: text/csv
Accept: application/json
body:
Name
Test1
Test2
Test3

however, it won't import any record to the custom object 'Title__c'. I can see the queue is added to the job but it's has 0 records to run with.
User-added image

I was wondering if i'm missing something or doing something wrong. 
Thanks
I'm trying to create a JSON content type of insert job using Bulk API and I'm getting "UnsupportedContentType" even with api v44.0.
Not sure if I'm missing something or doing something wrong but below it the detail:

Url
https://[my-instance].my.salesforce.com/services/data/v44.0/jobs/ingest

body
{
    "apiVersion" : 44.0,
    "contentType" : "JSON",
    "object" : "Title__c",
    "operation" : "insert"
}

response
[
    {
        "errorCode": "UNSUPPORTEDCONTENTTYPE",
        "message": "UnsupportedContentType : JSON is not a valid Content-Type. Only 'CSV' is allowed"
    }
]

 
I'm trying to create a JSON content type of insert job using Bulk API and I'm getting "UnsupportedContentType" even with api v44.0.
Not sure if I'm missing something or doing something wrong but below it the detail:

Url
https://[my-instance].my.salesforce.com/services/data/v44.0/jobs/ingest

body
{
    "apiVersion" : 44.0,
    "contentType" : "JSON",
    "object" : "Title__c",
    "operation" : "insert"
}

response
[
    {
        "errorCode": "UNSUPPORTEDCONTENTTYPE",
        "message": "UnsupportedContentType : JSON is not a valid Content-Type. Only 'CSV' is allowed"
    }
]

 
Hi, I'm trying to import csv data by using Bulk API 2.0 
I was able to created a job:

url: 
https://myinstance.my.salesforce.com/services/data/v44.0/jobs/ingest
headers: 
Content-Type:application/json; charset=UTF-8
Authorization:session_id
Accept:application/json
body:
{
    "contentType" : "CSV",
    "object" : "Title__c",
    "operation" : "insert",
    "lineEnding": "CRLF"
}

and I was trying to do a test run for adding batch to a job with dummy csv content.

url:
https://myinstance.my.salesforce.com/services/data/v44.0/jobs/ingest/job_id/batches
headers:
Content-Type: text/csv
Accept: application/json
body:
Name
Test1
Test2
Test3

however, it won't import any record to the custom object 'Title__c'. I can see the queue is added to the job but it's has 0 records to run with.
User-added image

I was wondering if i'm missing something or doing something wrong. 
Thanks
I'm trying to create a JSON content type of insert job using Bulk API and I'm getting "UnsupportedContentType" even with api v44.0.
Not sure if I'm missing something or doing something wrong but below it the detail:

Url
https://[my-instance].my.salesforce.com/services/data/v44.0/jobs/ingest

body
{
    "apiVersion" : 44.0,
    "contentType" : "JSON",
    "object" : "Title__c",
    "operation" : "insert"
}

response
[
    {
        "errorCode": "UNSUPPORTEDCONTENTTYPE",
        "message": "UnsupportedContentType : JSON is not a valid Content-Type. Only 'CSV' is allowed"
    }
]