hi
i try update lead info via REST, i use java. and my access be denied. {"requestId":"6a5e#1610d0b1142","success":false,"errors":[{"code":"603","message":"Access denied"}]}
can someone help me please.
URL url = new URL("https://004-BTR-463.mktorest.com/rest/v1/leads.json?access_token=31f4204f-52b0-4e08-b7cf-e81008e0fdf... ");
HttpsURLConnection urlConn = (HttpsURLConnection) url.openConnection();
urlConn.setRequestMethod("POST");
urlConn.setRequestProperty("Accept", "application/json");
urlConn.setRequestProperty("Content-Type","application/json; charset=UTF-8");
urlConn.setDoOutput(true);
urlConn.setDoInput(true);
urlConn.setUseCaches(false);
urlConn.setAllowUserInteraction(true);
DataOutputStream writer = new DataOutputStream(os);
syncLeadRequest =
{
"action": "updateOnly",
"lookupField": "id",
"input": [
{
"id": "").append(leadId).append("",
"objectTypeOfSFDCALT": "objectTypeOfSFDCALT",
"objectIdOfSFDCALT": "objectIdOfSFDCALT",
"lastSyncedDateToSFDCALT": "Date"
}
]
}
writer.writeBytes(syncLeadRequest);
writer.flush();
writer.close();
os.close();
Solved! Go to Solution.
Ensure the API user's role allows them to read/write leads.
Hi
thank you. you save problem again.
could you please tell me how to use custom role to do API job?
i follow document, create new user, new role, and add many right to the role, but i cannot see my user in "API Only User"when i install service in Launch Point.
so, i cannot user my custom-role, i have to use API(role), and now i have to add permission for it.
it's okay for now, but i want manage permission, i do not want all API user can write Lead. can i do it?
thank you!
You need to [1] create the role, [2] add a user to and during user setup make them API Only User and add them to the role, then [3] set up the custom service.