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
Sandeep001Sandeep001 

API currently Disabled Error - Sites Development

I have created a Sites Page and on one of the button clicks I am trying to open a page hosted on 3rd party server. I am using URL on click of button to open a new page but getting an error of API CURRENTLY DISABLED for this user.

The 'API ENABLE' checkbox is checked for the profile of my Sites' User. I am not gettin this error when I do the same action from Salesforce instance.

 

Please respond if anyone aware of this.

 

Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent

you are getting the correct error. Site (anonymous access doesn't have API access, only via apex).

You can use visualforce page or you might want to create a public apex webservice that you can call from your public site url

 

Message Edited by Bulent on 05-18-2009 11:46 AM

All Answers

BulentBulent

can you provide your page code here?

Site user doesn't have API access (you can't login as gust user and query system, but you can of course use apex)

but I don't understand why a link would give you that type of error 

Sandeep001Sandeep001

Hello Bulent, 

Thanks for the response. 

 

The URL we are tryin to open from Sites opens another page that is querying back our Salesforce org to fetch information. We are passing Salesforce Connection URL and Salesforce Connection Id as URL parameters. Thats the reason we are gettin this error.

 

Any ways to avoid this?

 

 

RyanGuestRyanGuest

What are you trying to accomplish?

 

Can you post your URL? 

Sandeep001Sandeep001

I am facing problem because Sites User cant login in SFDC and fire any SOQL query.

Is there any way I can login sites automatically as Customer Portal User?

 

Our URL is calling a Web service that queries our SFDC org with the helo of connection URL and COnnection Id we are sending as parameters.

 

 

 

 

BulentBulent

you are getting the correct error. Site (anonymous access doesn't have API access, only via apex).

You can use visualforce page or you might want to create a public apex webservice that you can call from your public site url

 

Message Edited by Bulent on 05-18-2009 11:46 AM
This was selected as the best answer
Sandeep001Sandeep001

If I create a apex web service and call it from my public Sites Page, I need to login first as a Standard user to access it because public Sites user wont be able to access it with anonymous access. 

 

So do you mean that Loggin as a standard user and access to webservice that again calls the 3rd party web service could solve this issue?

 

If yes, can you please provide an example of login as standard user using apex?

 

Thnks a lot, Bulent.

 

aalbertaalbert

Are you just trying to run a SOQL query from a Force.com Site? Why not use the Visualforce page's controller (ie apex class) to execute the query logic?

 

A few messages ago you also mentioned logging in as Customer Portal user. You can do that by associating a Customer Portal to your Site. Go to Setup -> Develop - > Site -> drill into your specific Site ->Login Settings. 

Secondly, once you tie the Site to a specific Customer Portal, you can use the Site's Apex class to login, link here

 

I hope that helps.