function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sctdevsctdev 

Http post of data

Is it possible to send an update of a contact or other data via an http post using basic authentication?

If so, could you point me to examples and documentation?

 

thanks,

 

sct

 

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
You have to call login, then call create, there's no support for basic auth. Given that in either case you're going to be sending credentials over the wire, skipping https is pretty risky.

All Answers

werewolfwerewolf
Sorry, what are you asking?  You want to authenticate and update a contact all in a single post operation?  Or do you want to make your own page which allows you to do this, say a PHP page?
sctdevsctdev

Yes, single operation.

I want to send some data to create a new record by an http post rather than the https from a handheld device to update mileage.

I was looking for a minimal footprint to send a single record update.

 

sct

SuperfellSuperfell
You have to call login, then call create, there's no support for basic auth. Given that in either case you're going to be sending credentials over the wire, skipping https is pretty risky.
This was selected as the best answer
werewolfwerewolf

Agree with Simon on this one.  As of today your options are:

 

- Write your own page in PHP or whatever that accepts the submission, authenticates itself to Salesforce.com on the backend and makes the relevant change

- Write an EmailService that takes an email from your mobile device or service and applies the change

 

Note that in both of these cases, the user himself is not relevant because he will not be sending his authentication info over the wire -- rather, the backend authenticates itself by itself using an admin or system user. 

sctdevsctdev

Do you mean a php page on the force server or elsewhere?

 

sct

werewolfwerewolf
Elsewhere.  You can't put a PHP page on a force.com server.  Sites is in developer preview, which in the future will allow you to create a Visualforce page that you can expose as an unauthenticated HTTP page, but it is not yet available for production orgs.