Microsoft announced a new tunneling request system for LinkedIn Marketing API system to replace the old request system that will be deprecated. However, I noticed that CREATE and UPDATE calls are not working in this new request system. The requests return with the answer I show below.
{
"serviceErrorCode": 0,
"message": "Invalid tunneled request - Missing start boundary",
"status": 400
}
I had the opportunity to work with CURL requests before, but I have never worked with multipart. As I mentioned below, where do you think the boundary is faulty in a CURL request?
curl -L -X POST 'https://api.linkedin.com/v2/atsCandidates' \
-H 'X-HTTP-Method-Override: PUT' \
-H 'Content-Type: multipart/mixed; boundary=xyz' \
-H 'x-restli-method: batch_update' \
-H 'Authorization: Bearer redacted' \
--data $'--xyz\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\nids[0].atsCandidateId=CAND123&ids[0].dataProvider=ATS&ids[0].integrationContext=urn:li:organization:1000&ids[1].atsCandidateId=CAND456&ids[1].dataProvider=ATS&ids[1].integrationContext=urn:li:organization:1000\r\n--xyz\r\n
Content-Type: application/json\r\n\r\n{
"entities": { "atsCandidateId=CAND123&dataProvider=ATS&integrationContext=urn:li:organization:1000": {
"addresses": [
{
"line1": "31 Spooner St",
"city": "Quahog",
"geographicArea": "RI",
"geographicAreaType": "STATE",
"postalCode": "02802",
"country": "us"
}
],
"atsCreatedAt": 1484864187000,
"atsLastModifiedAt": 1484864187000,
"currentCompanyName": "Pawtucket Patriot Brewery",
"currentJobTitle": "Quality Assurance",
"emailAddresses": [
"foo@example.com"
],
"externalProfileUrl": "https://example.com/p-griffin",
"firstName": "Peter",
"lastName": "Griffin",
"middleInitial": "L",
"phoneNumbers": [
{
"number": "555-555-5555",
"extension": "1234"
}
],
"prefix": "Mr",
"suffix": "Jr"
},
"atsCandidateId=CAND456&dataProvider=ATS&integrationContext=urn:li:organization:1000": {
"addresses": [
{
"line1": "1000 W Maude Ave",
"line2": "ATTN: Maude Flanders",
"city": "Calgary",
"geographicArea": "AB",
"geographicAreaType": "PROVINCE",
"postalCode": "T1X 0L3",
"country": "ca"
}
],
"atsCreatedAt": 1484864187000,
"atsLastModifiedAt": 1484864187000,
"emailAddresses": [
"foo@example.com"
],
"externalProfileUrl": "https://example.com/m-flanders",
"firstName": "Maude",
"lastName": "Flanders",
"phoneNumbers": [
{
"number": "555-666-7777",
"extension": "1234"
}
],
"prefix": "Mrs"
}
}
}\r\n--xyz--'