When I perform a search by LastUpdatedTime I get "401 Unauthorized Error". Query by CustomerId works fine
Here is my code:
var pq = new PaymentQuery()
{
LastUpdatedTime = new DateTime(2012,12,21),
};
pq.SpecifyOperatorOption(Intuit.Ipp.Data.Qbo.FilterProperty.LastUpdatedTime, FilterOperatorType.AFTER);
var list = pq.ExecuteQuery<Payment>(commonService.ServiceContext);
Application throws Intuit.Ipp.Exception.InvalidTokenException in ExecuteQuery
The SDK does not encode the datetime correctly, so you will need to use DevDefined and deserialize the response with the SDK. Code sample: https://gist.github.com/IntuitDeveloperRelations/6024616
What does the full error look like?
Are you able to do other calls fine with this company using the token sets & realm ID that you have in place?
Related
I'm attempting to use indico's sentiment analysis api, I've debugged and inspected the "indico" object, and confirmed the correct api key is stored within it. I am also able to make calls to the API using curl from terminal, so I don't believe its my network settings (unless its something java specific?).
The code:
public double querySentiment(String qsent) throws UnsupportedOperationException, IOException, IndicoException{
double response = 0;
indico = new Indico(apikey);
IndicoResult single = indico.sentiment.predict(qsent);
log.inf("QUERY SEND SUCCESSFUL");
response = single.getSentiment();
log.inf("QUERY RECEIVE SUCCESSFUL");
return response;
}
The exception:
java.lang.IllegalArgumentException: API key not found. To use our API, sign up for a free account and api key at http://indico.io/register.
Wrong code snippet is given on indico API site. You have to pass key in params as well while making an indico object. Below code will work.
HashMap<String,String> params = new HashMap<String,String>();
params.add("api_key",apikey);
indico = new Indico(apikey,params);
I'm trying to use a service of DocuSign API in an abap project. I want to send a document to a specific email so it can be signed. But im getting the following error:
"errorCode": "INVALID_REQUEST_PARAMETER",## "message": "The request contained at least one invalid parameter. Query parameter 'from_date' must be set to a valid DateTime, or 'envelope_ids' or 'transaction_ids' must be specified.
I tried the following:
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = l_url (https://demo.docusign.net/restapi/v2/accounts/XXXXXX')
proxy_host = co_proxy_host
proxy_service = co_proxy_service
IMPORTING
client = lo_http_client
lo_http_client->request->set_method( method = 'POST').
CALL METHOD lo_http_client->request->set_header_field
EXPORTING
name = 'Accept'
value = 'application/json'.
CALL METHOD lo_http_client->request->set_header_field
EXPORTING
name = 'X-DocuSign-Authentication'
value = get_auth_header( ). (json auth header)
CALL METHOD lo_http_client->request->set_cdata
EXPORTING
data = create_body( ).
This is my body:
CONCATENATE
`{`
`"emailSubject": "DocuSign REST API Quickstart Sample",`
`"emailBlurb": "Shows how to create and send an envelope from a document.",`
`"recipients": {`
`"signers": [{`
`"email": "test#email",`
`"name": "test",`
`"recipientId": "1",`
`"routingOrder": "1"`
`}]`
`},`
`"documents": [{`
`"documentId": "1",`
`"name": "test.pdf",`
`"documentBase64":` `"` l_encoded_doc `"`
`}],`
`"status": "sent"`
`}` INTO re_data.
The api request to get the Baseurl is working fine. (I know the error is quite specific what the problem is, but i cant find any sources on the docusign api documentation that one of the mentioned parameters should be added to the request)
Thank you in regards
The error message seems to indicate that you're Posting to an endpoint that requires certain query string parameters -- but you're not specifying them as expected in the query string. I'd suggest you check the DocuSign API documentation for the operation you are using, to determine what query string parameters it requires, and then ensure that you're including those parameters in your request URL.
If you can't figure this out using the documentation, then I'd suggest that you update your post to clarify exactly what URL (endpoint) you are using for the request, including any querystring parameters you're specifying in the URL. You can put fake values for things like Account ID, of course -- we just need to see the endpoint you are calling, and what qs params you're sending.
To create an envelope, use
https://demo.docusign.net/restapi/v2/accounts/XXXXXX/envelopes
instead of
https://demo.docusign.net/restapi/v2/accounts/XXXXXX
Thank you for all the answers, i found the mistake. Creating the request wasn´t the problem. I was using the wrong "sending"-method -_-.
now its working :)
lo_rest_client->post( EXPORTING io_entity = lo_request_entity ).
It is said, that it is not possible to initiate new conversation through the API alone, except using Facebook's own Form integrated in the app. Is this correct, or is there some new API, which enables me to initiate a new conversation?
To reply to an existing conversation, I retrieved the conversations id using the following FQL Query "SELECT thread_id, . WHERE viewer_id={0} AND folder_id=0". Afterwards I retrieved the PageAccessToken for my app page using my user Access token, and tried to use this call:
*You can reply to a user's message by issuing an HTTP POST to /CONVERSATION_ID/messages with the following parameters [conversation id, message]. A conversation ID look like t_id.216477638451347.*
My POST Call looked like this (this is not a valid thread id): /t_id.2319203912/messages with message parameter filled. But it always said "Unknown method". Can you help me out with this one? Is there a parameter missing? I passed in the page's Access Token to call this one.
Is there some API out (except Facebook's Chat API), that I am missing, which can send private messages to users?
Edit:
What I wonder about is, that the code below only returns a single page, the application's page. Is this correct, or is there another page token required? This is what bugged me the most about the returned page.
The FacebookClient uses my UserToken to perform the next following task.
This is the code to retrieve my Page Access Token:
dynamic pageService = FacebookContext.FacebookClient.GetTaskAsync("/"+UserId+"/accounts").Result;
dynamic pageResult = pageService.data[0];
_pageId = pageResult["id"].ToString();
return pageResult["access_token"].ToString();
Now the code to retrieve my ConversationĂd:
dynamic parameters = new ExpandoObject();
parameters.q = string.Format("SELECT thread_id, folder_id, subject, recipients, updated_time, parent_message_id, parent_thread_id, message_count, snippet, snippet_author, object_id, unread, viewer_id FROM thread WHERE viewer_id={0} AND folder_id=0", FacebookContext.UserId);
dynamic conversations = FacebookContext.FacebookClient.GetTaskAsync("/fql",parameters).Result;
The following code is executed using the access token retrieved from the code above (page access token request).
Now the Code used to send the reply:
dynamic parameters = new ExpandoObject();
parameters.message = CurrentAnswer;
string taskString = "/t_id." + _conversationId + "/messages";
dynamic result = FacebookContext.FacebookClient.PostTaskAsync(taskString,parameters).Result;
return true;
I also tried it with facebook's graph API Debugger using the token, which is returned by my first part of code. But with the same error message.
Yelp API V2.0 have problem to get response .when i send request in yelp API V2.0 with all authentication key and token , i get error missing parameter . if any one have idea regarding Yelp help me
If you get this error:
{"error":{"text":"One or more parameters are invalid in
request","id":"INVALID_PARAMETER","field":"oauth_timestamp"}}
then your timestamp is sometime in the past. You can resolve this by dynamically getting the current time or by setting the timestamp parameter to some arbitrary value in the future.
You got that error because you are not using the keys themselves "The OAuth credentials are invalid" ...oauth_consumer_key=mykey&auth_consumer_secret=mykey...
it should look like this ...oauth_consumer_key=XXXXXXXXXXXXXXXXXXXXX&auth_consumer_secret=XXXXXXXXXXXXXXXXXXXXX...
Have a look at their github https://github.com/Yelp/yelp-api/tree/master/v2/ they have some examples that might help for example on the PHP
// Set your keys here
$consumer_key = "";
$consumer_secret = "";
$token = "";
$token_secret = "";
you should set your keys in between the quotes $consumer_key = "XXXXXXXXXXXXXXXXXXXXX";
How can I query full roster using JSJAC XMPP client? I have tried following function for this, but it does not work:
function getRoster(con){
var roster = new JSJaCIQ();
roster.setIQ(null, 'get', 'roster_1');
roster.setQuery(NS_ROSTER);
con.send(roster);
}
Instead of con.send, try:
con.sendIQ(roster, {result_handler: function(aIq, arg) {
var node = aIq.getQuery()
// do something with roster
});
You need to have a callback that fires when the roster is returned. To be complete, set a error_handler as well, in case an IQ error is returned or you time out.
sorry for commenting on such old question, hoewever this pops as #1 result in google on 'JSJAC roster' and the above answers didn't worked for me. i don't know whether something changed in the JSJaC API, however i was receiving iq errors 'service-unavaliable'. i had to use this code instead:
var rosterRequest = new JSJaCIQ();
rosterRequest.setType('get');
rosterRequest.setQuery(NS_ROSTER);
connection.send(rosterRequest);
(so no domain setting and no id setting - just the type, and namespace).