Quantcast
Channel: LivePerson Connect : Popular Discussions - All Communities
Viewing all articles
Browse latest Browse all 2324

Null for uri: availableSlots

$
0
0

I am using Jersey to access the RESTful Agent API.  when ever I access the any of the various calls under agentSession, such as info or availability i get a valid response back, see the following log statements.

 

1 * Client out-bound request
1 > Authorization: OAuth oauth_signature="u50VLUIe6Vq%2B%2FiIdqZ7eV5ru8MI%3D", oauth_nonce="2750e2d8-6c5b-4a84-9262-13daa21877cb", oauth_version="1.0", oauth_consumer_key="0a14003f34404de6a5c6c521e1361797", oauth_signature_method="HMAC-SHA1", oauth_token="c23141d49afc443abac4e5c200fa5633", oauth_timestamp="1348505498"
1 >
1 * Client in-bound response
1 < 200
1 < Content-Length: 336
1 < X-Powered-By: ASP.NET
1 < P3P: CP="NON BUS INT NAV COM ADM CON CUR IVA IVD OTP PSA PSD TEL SAM"
1 < Content-Type: application/xml
1 < Server: Microsoft-IIS/6.0
1 < Date: Mon, 24 Sep 2012 16:54:43 GMT
1 <
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><info><link href="https://dev.liveperson.net/api/account/P17392557/agentSession/326695936/info" rel="self"/><agentName>Peter</agentName><displayName>Peter</displayName><loginName>peter</loginName><id>4</id><maxChats>1</maxChats><availability><chat>Away</chat></availability></info>
[INFO ] 2012-09-24 10:56:39 org.familysearch.ws.rt.servlet.LoggingFilter.access - ramesbury-ThinkPad-W520/127.0.1.1   ,"Mon Sep 24 10:56:39 MDT 2012","2012-09-24","10:56:39","null","POST","/community/ask/v1/chat/testchat","null","204","null","No Content","259","null","null","null","null","127.0.0.1","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11"
When ever i attempt to call availableSlots passing in any of the query parameters, i get back a response that the uri is null, see the folowing log statement.
1 * Client out-bound request
1 > Authorization: OAuth oauth_signature="DiQvCuulvvjO1qsEMVhl24rFoQA%3D", oauth_nonce="619d093e-f127-4799-9464-077fae3fce64", oauth_version="1.0", oauth_consumer_key="0a14003f34404de6a5c6c521e1361797", oauth_signature_method="HMAC-SHA1", oauth_token="c23141d49afc443abac4e5c200fa5633", oauth_timestamp="1348505502"
1 >
1 * Client in-bound response
1 < 404
1 < Content-Length: 256
1 < X-Powered-By: ASP.NET
1 < P3P: CP="NON BUS INT NAV COM ADM CON CUR IVA IVD OTP PSA PSD TEL SAM"
1 < Content-Type: application/xml
1 < Server: Microsoft-IIS/6.0
1 < Date: Mon, 24 Sep 2012 16:54:47 GMT
1 <
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><error><time>2012-09-24T12:54:47.227-04:00</time><message>null for uri: /api/account/P17392557/agentSession/326695936/availableSlots?v=1&amp;agent=Peter</message><internalCode>28</internalCode></error>
[INFO ] 2012-09-24 10:56:42 org.familysearch.ws.rt.servlet.LoggingFilter.access - ramesbury-ThinkPad-W520/127.0.1.1   ,"Mon Sep 24 10:56:42 MDT 2012","2012-09-24","10:56:42","null","POST","/community/ask/v1/chat/testchat","null","204","null","No Content","116","null","null","null","null","127.0.0.1","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11"

 

I see that the & is being encoded at some point, but I am not sure where or how to prevent it.

 

Following are the code snipets that i think are important.

 

private static final String URI_AGENT_SESSION = "https://dev.liveperson.net/api/account/%s/agentSession/%s/%s?v=1";

 

 

     public void agentSession(String session, String URI) {

        WebResource webResource = authenticate(String.format(URI_AGENT_SESSION, ACCOUNT_ID, session, URI));

        ClientResponse clientResponse = get(webResource.getRequestBuilder());

    }

 

    public void agentSession2(String session, String URI) {

        WebResource webResource = authenticate(String.format(URI_AGENT_SESSION, ACCOUNT_ID, session, URI));

        webResource = webResource.queryParam("agent", "Peter");

        ClientResponse clientResponse = get(webResource.getRequestBuilder());

    }

 

private WebResource authenticate(String URI) {

        OAuthParameters parameters = new OAuthParameters();

        OAuthSecrets secrets = new OAuthSecrets();

        parameters.signatureMethod(SIGNATURE_METHOD);

        parameters.consumerKey(CONSUMER_KEY);

        parameters.setToken(TOKEN_KEY);

        parameters.setVersion(OAUTH_VERSION);

        parameters.nonce();

        parameters.setTimestamp(date);

        secrets.consumerSecret(CONSUMER_SECRET);

        secrets.setTokenSecret(TOKEN_SECRET);

        Client client = Client.create();

        client.addFilter(new LoggingFilter(System.out));

        WebResource resource = client.resource(URI);

        OAuthClientFilter filter = new OAuthClientFilter(client.getProviders(), parameters, secrets);

        resource.addFilter(filter);

        return resource;

    }

 

private ClientResponse get(WebResource.Builder builder) {

        return builder.get(ClientResponse.class);

    }

 

Any thoughts on why this uri is coming back as null?


Viewing all articles
Browse latest Browse all 2324

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>