" -H "X-PrettyPrint:1" -H "Content-Type: application/json" --data-binary @patchtask.json -X PATCH patchtask.json: { "Status" : "In Progress" } I can't get it to work with the desktop modeler.   The resulting REST Consume Trace Logs for the Request & Response are:   Request content for PATCH request to https://na85.salesforce.com/services/data/v44.0/sobjects/Task/00T1U000003roAbUAI HTTP/1.1 Authorize: Bearer X-PrettyPrint: 1 Content-Type: application/json {"Status":"In Progress"} -------------------- Response content for PATCH request to https://na85.salesforce.com/services/data/v44.0/sobjects/Task/00T1U000003roAbUAI HTTP/1.1 401 Unauthorized Date: Fri, 21 Dec 2018 20:11:57 GMT Strict-Transport-Security: max-age=31536000; includeSubDomains X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Content-Security-Policy: upgrade-insecure-requests X-Robots-Tag: none Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private Set-Cookie: BrowserId=JrhGqppqSaOnxPZnbacoXQ;Path=/;Domain=.salesforce.com;Expires=Tue, 19-Feb-2019 20:11:57 GMT;Max-Age=5184000 Expires: Thu, 01 Jan 1970 00:00:00 GMT WWW-Authenticate: Token Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked [ { "message" : "Session expired or invalid", "errorCode" : "INVALID_SESSION_ID" } ] REST Action configuration: I've tried a number of variations, including a custom request template.   Most of them resulted in the same response.  I'm not sure what the Desktop Modeler's request is supposed to look like so I've tried to make it as close to the working curl request as I can.   I would greatly appreciate any help you can provide. "> " -H "X-PrettyPrint:1" -H "Content-Type: application/json" --data-binary @patchtask.json -X PATCH patchtask.json: { "Status" : "In Progress" } I can't get it to work with the desktop modeler.   The resulting REST Consume Trace Logs for the Request & Response are:   Request content for PATCH request to https://na85.salesforce.com/services/data/v44.0/sobjects/Task/00T1U000003roAbUAI HTTP/1.1 Authorize: Bearer X-PrettyPrint: 1 Content-Type: application/json {"Status":"In Progress"} -------------------- Response content for PATCH request to https://na85.salesforce.com/services/data/v44.0/sobjects/Task/00T1U000003roAbUAI HTTP/1.1 401 Unauthorized Date: Fri, 21 Dec 2018 20:11:57 GMT Strict-Transport-Security: max-age=31536000; includeSubDomains X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Content-Security-Policy: upgrade-insecure-requests X-Robots-Tag: none Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private Set-Cookie: BrowserId=JrhGqppqSaOnxPZnbacoXQ;Path=/;Domain=.salesforce.com;Expires=Tue, 19-Feb-2019 20:11:57 GMT;Max-Age=5184000 Expires: Thu, 01 Jan 1970 00:00:00 GMT WWW-Authenticate: Token Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked [ { "message" : "Session expired or invalid", "errorCode" : "INVALID_SESSION_ID" } ] REST Action configuration: I've tried a number of variations, including a custom request template.   Most of them resulted in the same response.  I'm not sure what the Desktop Modeler's request is supposed to look like so I've tried to make it as close to the working curl request as I can.   I would greatly appreciate any help you can provide. "> " -H "X-PrettyPrint:1" -H "Content-Type: application/json" --data-binary @patchtask.json -X PATCH patchtask.json: { "Status" : "In Progress" } I can't get it to work with the desktop modeler.   The resulting REST Consume Trace Logs for the Request & Response are:   Request content for PATCH request to https://na85.salesforce.com/services/data/v44.0/sobjects/Task/00T1U000003roAbUAI HTTP/1.1 Authorize: Bearer X-PrettyPrint: 1 Content-Type: application/json {"Status":"In Progress"} -------------------- Response content for PATCH request to https://na85.salesforce.com/services/data/v44.0/sobjects/Task/00T1U000003roAbUAI HTTP/1.1 401 Unauthorized Date: Fri, 21 Dec 2018 20:11:57 GMT Strict-Transport-Security: max-age=31536000; includeSubDomains X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Content-Security-Policy: upgrade-insecure-requests X-Robots-Tag: none Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private Set-Cookie: BrowserId=JrhGqppqSaOnxPZnbacoXQ;Path=/;Domain=.salesforce.com;Expires=Tue, 19-Feb-2019 20:11:57 GMT;Max-Age=5184000 Expires: Thu, 01 Jan 1970 00:00:00 GMT WWW-Authenticate: Token Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked [ { "message" : "Session expired or invalid", "errorCode" : "INVALID_SESSION_ID" } ] REST Action configuration: I've tried a number of variations, including a custom request template.   Most of them resulted in the same response.  I'm not sure what the Desktop Modeler's request is supposed to look like so I've tried to make it as close to the working curl request as I can.   I would greatly appreciate any help you can provide. ">
Call REST action with PATCH method - Mendix Forum

Call REST action with PATCH method

0

Hello!   I'm trying to use the REST PATCH method to update a field in Salesforce.  I've successfully done a post to get the access token and many GETs to obtain lots of data from my Salesforce developer instance.  I've also successfully implemented the PATCH method via curl.  

curl https://na85.salesforce.com/services/data/v44.0/sobjects/Task/00T1U000003roAbUAI -H "Authorization: Bearer <access token>" -H "X-PrettyPrint:1" -H "Content-Type: application/json" --data-binary @patchtask.json -X PATCH

patchtask.json:

{
	"Status" : "In Progress"
}

I can't get it to work with the desktop modeler.

 

The resulting REST Consume Trace Logs for the Request & Response are:  

Request content for PATCH request to https://na85.salesforce.com/services/data/v44.0/sobjects/Task/00T1U000003roAbUAI HTTP/1.1
Authorize: Bearer <access token>
X-PrettyPrint: 1
Content-Type: application/json

{"Status":"In Progress"}

--------------------
Response content for PATCH request to https://na85.salesforce.com/services/data/v44.0/sobjects/Task/00T1U000003roAbUAI
HTTP/1.1 401 Unauthorized
Date: Fri, 21 Dec 2018 20:11:57 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: upgrade-insecure-requests
X-Robots-Tag: none
Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
Set-Cookie: BrowserId=JrhGqppqSaOnxPZnbacoXQ;Path=/;Domain=.salesforce.com;Expires=Tue, 19-Feb-2019 20:11:57 GMT;Max-Age=5184000
Expires: Thu, 01 Jan 1970 00:00:00 GMT
WWW-Authenticate: Token
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked

[ {
  "message" : "Session expired or invalid",
  "errorCode" : "INVALID_SESSION_ID"
} ]

REST Action configuration:

I've tried a number of variations, including a custom request template.   Most of them resulted in the same response.  I'm not sure what the Desktop Modeler's request is supposed to look like so I've tried to make it as close to the working curl request as I can.  

I would greatly appreciate any help you can provide. 

asked
2 answers
1

At the very least, you header should be called Authorization.

answered
0

Is it possibly an accesstoken that you can use only once and you do use it already between the Post where you receive the accesstoken and the PATCH?

answered