Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package ru.hh.oauth.subscribe.apis;
 
 
 public class FreelancerApi extends DefaultApi10a {
 
     private static final String AUTHORIZATION_URL = "http://www.freelancer.com/users/api-token/auth.php?oauth_token=%s";
    @Override
    public String getAccessTokenEndpoint() {
        return "http://api.freelancer.com/RequestAccessToken/requestAccessToken.xml?";
    }
    @Override
    public String getRequestTokenEndpoint() {
        return "http://api.freelancer.com/RequestRequestToken/requestRequestToken.xml";
    }
    @Override
    public Verb getAccessTokenVerb() {
        return .;
    }
    @Override
    public Verb getRequestTokenVerb() {
        return .;
    }
    @Override
    public String getAuthorizationUrl(Token requestToken) {
        return String.format(requestToken.getToken());
    }
    public static class Sandbox extends FreelancerApi {
        private static final String SANDBOX_AUTHORIZATION_URL = "http://www.sandbox.freelancer.com/users/api-token/auth.php";
        @Override
        public String getRequestTokenEndpoint() {
            return "http://api.sandbox.freelancer.com/RequestRequestToken/requestRequestToken.xml";
        }
        @Override
        public String getAccessTokenEndpoint() {
            return "http://api.sandbox.freelancer.com/RequestAccessToken/requestAccessToken.xml?";
        }
        @Override
        public String getAuthorizationUrl(Token requestToken) {
            return String.format( + "?oauth_token=%s"requestToken.getToken());
        }
    }
New to GrepCode? Check out our FAQ X