Phillip Brooks Posted October 16, 2015 Report Share Posted October 16, 2015 I'm trying to use the LabVIEWHTTPClient.lvlib functions to communicate with Salesforce.com I can authenticate, but my Salesforce IT guy tells me that Salesforce uses a concept called "upsert". It's update and insert combined; but I need to use the PATCH Method instead of a PUT or POST method. I can't seem to find any reference to the PATCH method. I believe the LabVIEW library uses curl under the hood. Anyone have any ideas? HEADER: HTTP/1.1 405 Method Not Allowed Date: Fri, 16 Oct 2015 19:20:35 GMT Sforce-Limit-Info: api-usage=36839/7918000 Allow: GET,HEAD,PATCH,DELETE Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked BODY: [{"errorCode":"METHOD_NOT_ALLOWED","message":"HTTP Method 'POST' not allowed. Allowed are GET,HEAD,PATCH,DELETE"}] Quote Link to comment
ShaunR Posted October 16, 2015 Report Share Posted October 16, 2015 "Upsert" is a database function. I don't know how the salesforce thing is set up but I don't think this has anything to do with HTTP but is probably describing a query executed by the HTTP request. PATCH is detailed here. It won't help you with using the NI HTTP VIs though because I believe they only implement GET and POST. You will have to fall back to the TCPIP primitives and hand craft the HTTP headers and body. Maybe Rolfs HTTP VIs would be useful here. Quote Link to comment
Phillip Brooks Posted October 26, 2015 Author Report Share Posted October 26, 2015 (edited) I was traveling last week, so I didn't get to spend much time on this. While searching salesforce.com I discovered that you can override the POST method with an arbitrary method name by appending to the URL. https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_update_fields.htm Append "?_HttpMethod=PATCH" and Bob's your uncle! Edited October 26, 2015 by Phillip Brooks Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.