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
ChadSaChadSa 

Guest User and Web Services

Is it possible to use a guest user via API calls to webservices?

 

If not, what are the alternatives?  Is there a way to set up your own guest users and authenticate using that guest user's credentials?

Best Answer chosen by Admin (Salesforce Developers) 
UVUV

As an option You can use standard Servlet url to generate a lead in salesforce what you get from the Web to Lead form if you dont want to use api's to generate the lead else you would need to login first to generate the lead..There is no other way out.

All Answers

UVUV

Guest user doesn't have access to the Api's..You can make a login call by a salesforce licence  and then check guest User credentials.

ChadSaChadSa

Thanks Umesh,

 

Guest user doesn't have access to the Api's..You can make a login call by a salesforce licence  and then check guest User credentials.

 

 

So to clarify this a bit, my app is using a customer portal and can either be an authenticated user or a guest, just as they would on the portal page.  So what I'd need to do on the back end is  log in via the API using a license associated with the company when the user is not logged in. And then check the guest user credentials for what?  Do you mean check quest permissions before performing an action?  Or do you mean actually lookup the guest credentials (if there are any) and use those to log in?  Is that a security risk?  We'll be only creating a Lead record (including custom fields) via web services, so there's a very limited set of things that the webservice can do, but I want to make sure I'm not opening things up in a way I shouldn't.

UVUV

Sorry, I was not clear with your problem statement..

What I understood is that you are having a customer portal where portal users with portal license can login and guest user will contact you by using using any form or something like that which will generate the lead in salesforce..Am I correct???

That lead you will generate using Api's...Right??

I guess, using Customer portal license you wont be able to use APi's..So, to generate a lead using api's you will need to use salesforce platform license.

 

Does this answer ur questions??? 

ChadSaChadSa

What I understood is that you are having a customer portal where portal users with portal license can login and guest user will contact you by using using any form or something like that which will generate the lead in salesforce..Am I correct???

yes

 

That lead you will generate using Api's...Right??

yes

 

I guess, using Customer portal license you wont be able to use APi's..So, to generate a lead using api's you will need to use salesforce platform license.

We are able to use the customer portal via the API, as long as the user is authenticated ( they have their own user name and password).  However, I'm having a little difficulty allowing users who don't already have a login to generate a lead.

 

On the webpage for the portal itself, guest users can access the form just like authenticated users.  The only difference is is that the authenticated user gets information auto-filled for them.

 

My iOS app replicates the form and works with an authenticated user.  For the guest user, all the data is collected in the app and the last step would be to push the lead information to salesforce, but it appears that I'm not able to do that via the API, without authenticating somehow first.

 

I was hoping for one of two solutions

1. to be able to tell the API, user was a guest (prefered - doesn't appear to be possible)

2. to create a user that has guest access that the app logs in automatically when user submits from app, creates the lead and logs out (this presents a problem in that the credentials would be hard coded in the app and when the password expires, would need to be updated again)

 

Also, I'm new to salesforce, and am primarily an iOS developer.  Everything I know about saleforce has been only to integrate it with the app, so I apologize for my slowness in picking this up.

UVUV

As an option You can use standard Servlet url to generate a lead in salesforce what you get from the Web to Lead form if you dont want to use api's to generate the lead else you would need to login first to generate the lead..There is no other way out.

This was selected as the best answer
ChadSaChadSa

So would this include being able to set custom fields?  Or would that apply to just the standard Lead fields.

 

Thanks for all your help, I'll take a look into this.

UVUV

That would work for custom field as well...you need to create a form only and use below url as a form action to create a lead..like this-

<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">

 

When you go to web to lead setup..it will give you option to select fields to make available on the form and you can select any number of fields.After that just generate the form...It will be simple html so you can change look and feel using css.

ChadSaChadSa

Great, Thanks!