Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need better documentation for customizing API requests #7

Open
abalonepaul opened this issue Oct 30, 2012 · 10 comments
Open

Need better documentation for customizing API requests #7

abalonepaul opened this issue Oct 30, 2012 · 10 comments

Comments

@abalonepaul
Copy link

I am creating a new api plugin for salesforce. I was having trouble authenticating because Salesforece require request_type in the authorization call.

I added the response_type to the database config and then added this on line 247 of OauthComponent

        if (!empty($this->_config[$this->useDbConfig]['response_type'])) {
            $redirect .= '&response_type=' . $this->_config[$this->useDbConfig]['response_type'];
        }
@ProLoser
Copy link
Member

Think you could open a pull request?

@ProLoser
Copy link
Member

I would also recommend throwing the plugin into a repo online so I can help you out with it and link people to it!

@abalonepaul
Copy link
Author

I can't release the plugin as it is for a client, and I don't have the authority to release it as of yet. I will checkout the HttpSocketOauth and do a pull request.

Take care,

Paul

@abalonepaul
Copy link
Author

This apparently worked for the authorization, but now it sends it on other calls as well. I'm having a hell of a time trying to get this to work with Salesforce. It appears as though their flow is considerably different. The rest url is generated dynamically and returned with the access token. The REST calls do not need the client_id or secret. They only need the Authorization header set. The format is simply "Oauth access_key"

@ProLoser
Copy link
Member

ProLoser commented Nov 8, 2012

You are expected to extend the ApisSource and define your own class. If you do, you can override the methods (and call the parent method from within) or you could simply define a beforeRequest() method to make any last-minute modifications.

Again, if you had some code online to review (just the datasource only) this would be a lot easier. Are you creating a separate plugin/datasource/config file that extends this one? Or are you just modifying this directly and/or modifying the request object directly?

@abalonepaul
Copy link
Author

I think I got it worked out. I definitely had to override some methods. I'll try to push the basic plugin when I wrap up the project.

@ProLoser
Copy link
Member

Are you leveraging an API config map or are you just putting in the paths directly?

@abalonepaul
Copy link
Author

I did both. I used the path directly until I figured it out. Now I am using a config may. I was not getting the results I wanted from some of the calls, so I ended up using SOQL and currently have that working in a rudimentary fashion. I am going to pull some of the query builder methods to build and pass SOQL queries.

tenebrousedge added a commit that referenced this issue Jan 7, 2013
tenebrousedge added a commit that referenced this issue Jan 7, 2013
@tenebrousedge
Copy link
Member

This does not appear to be an issue with the plugin itself. There are a number of ways to customize API requests. I am leaving this issue open and changing the title to reflect a need for better documentation regarding this.

@abalonepaul
Copy link
Author

You should be able to close this. I was able to make it work without modifying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants