User should always specify what content it's expecting with Accept header. It's you job to return the error that was thrown/caught on the server side in the format that was specified in Accept header. In spring as far as I know it could be achieved with a special mapper. Below...
json,api,web,large-data-volumes
Either mReader.GetString(i) is returning null or you have no data in the columns.
php,angularjs,api,angular-resource
There is no particular standard for how arrays should be serialized into query strings. Different back ends expect different formats. This current method (in 1.1.x) was chosen specifically because it allows the developer the most flexibility. You can get your desired serialization by giving setting params to: params = {...
javascript,api,xmlhttprequest,twitch
The Twitch.tv API doesn't support CORS. You need to use JSON-P (aka JSONP) to work around it. Read more about that in the Twitch.tv API docs. There is a prior answer on how to make a JSONP request with native JavaScript that may be useful.
Check my own solution Steps: Go to https://console.developers.google.com/project and create project. Select project, select APIs & auth from top left corner menu. Select Credentials Create OAuth with button Create new Client ID (Application type - Installed Aplication. Fill field Product Name Save After that you got Client ID for native...
First question, is it possible to get a users playlist tracks using client credentials flow? Yes, retrieving tracks for a playlist doesn't require user authentication as part of the access token. I've also tried creating the API variable using $api = new SpotifyWebAPI\SpotifyWebAPI(); but this says I need user...
Not exactly if they didn't change the way they sample from the time this blog post was written: http://blog.falcondai.com/2013/06/666-and-how-twitter-samples-tweets-in.html According to the article they send the tweets that where published between the 657th and the 666th millisecond. So it's not exactly 1% but a good approximation....
java,api,wso2,wso2-am,api-manager
The Test button will send HTTP OPTION request to the endpoint, and if the endpoint supports HTTP OPTION request, then it is shown as valid. As far as your backend point support the HTTP method you need, you don't need to worry about this Test button against the endpoint....
the last one is correct, you just need to use facet not facets in the page you specified "https://developer-programs.linkedin.com/documents/company-search" facets is the output you get from the request while facet is the input....
.net,angularjs,api,angular-resource
You can modify data using transformRequest ResourceModule.service('PartProgramsResource', function ($resource) { var url = _baseUrl + '/parts/:partId/programs' return $resource(url, { partId: '@partId' }, { add: { method: 'POST', transformRequest: function (data, headersGetter) { //modify data and return it return angular.toJson(data); }, isArray: true } }); }) Am not 100% sure why...
php,web-services,api,rest,http
Your resource URIs should be more or less constant, and the HTTP verb determines what action is performed, eg: /api/orders: GET: list orders POST: create new order /api/orders/{order-id}; GET: retrieve info about an order POST: create an order with the specified ID PUT: modify an order DELETE: remove an order...
There are multiple types of account limitations. For most limitations you can continue to accept payments. In other cases not. If PayPal is uncertain about whether an account may have been compromised, or lacks a required piece of paperwork, they will generally only limit withdrawals so that the merchant can...
api,windows-phone,alarm,dismiss
Until today there is no API for dismiss alarm/reminder programatically.
javascript,node.js,api,express
The problem with for loops, or any loops is, that they are usually fast. In fact, it takes about several microseconds to loop over the list. This means that within a range of a few microseconds, you schedule several anonymous functions to be called after 1.5 seconds. This means that...
I don't clearly see why this got downvoted, but nevermind. I found the solution myself: The Ambari Metrics API can deliver the data in question, e.g. CPU load, memory usage, Network bandwith or load factors by sending a GET Request to http://<ambari-server>:8080/api/v1/clusters/<cluster-name>?fields=metrics/<metric>[<start>,<end>,<step>] while the metric can be network, cpu, cpus,...
angularjs,api,symfony2,oauth,wsse
It all depends on what your requirements are. First of all, OAuth 2 is an authentication mechanism/spec which you can use in combination with sessions/bearer tokens/... This also applies for local accounts (since you want to do user registration). FOSAuthServerBundle is a bundle to implement the server-side of the OAuth2...
asp.net-mvc,api,httpresponse,email-attachments
Well, apparently there is a solution for my problem. What I had to do was to get the HttpContent from the API's HttpResponseMessage as Stream. After that, all the process was a piece of cake. Here is the solution. It works great. HttpResponseMessage response = _service.GetAPIResponse(...); Stream data = response.Content.ReadAsStreamAsync().Result;...
You are attempting to write 36 bytes instead of 6, effectively accessing bytes beyond the end of the string. Definitely undefined behaviour. Only the first '\0' byte is expected. Use fwrite("Hello\n", 1, 6, cmd); Or more simply: fputs("Hello\n", cmd); ...
At the time of this posting, the REST API is not yet complete. A much more detailed document exists, though it's still not comprehensive. It is linked to in the following email from the user mailing list (which you might want to consider joining): http://www.mail-archive.com/user%40nutch.apache.org/msg13652.html But to answer your question...
So after hours trying to find out what the problem is, I have figured this out. The problem was the part where I tried to encode my hash to JSON. Apparently Rails or my application do not understand the .to_json method, so I had to use the JSON.generate(data) serialization as...
Those are placeholders value, that you would need to replace by an actual value in order to use those links. It serves to remind a user how to access, for instance, the following_url for another user. without {/other_user}, that url https://api.github.com/users/zhuhuihuihui/following would list all users followed. with {/other_user}, that url...
ruby-on-rails,ruby,api,curl,client
The IP of the client can change frequently and will only show the IP of their ISP, so limiting an API that may get called from the browser by IP might not be a good idea. CORS is related to resources (javascript, fonts, etc.) loaded by the browser over different...
api,symfony2,exception-handling,doctrine
The Symfony validator service can be used directly to validate any object for which validation constraints are defined. For example in a controller: $validator = $this->get('validator'); $errors = $validator->validate($test); To perform validation within a service you can pass the validator service into your service....
Try to separate API from your application logic. From API you GET the quote and API from now on shouldn't care what you do with that data. The same with marking quotes as favorites. It's your application's and user db's problem how to mark something. Again, API should care only...
ios,objective-c,api,rest,office365
The meeting invitation will show up as a Message in the user's inbox. You would use the Mail API to access this. For the most part it looks like a normal email, but it has a few extra properties. "MeetingMessageType": "MeetingRequest", "[email protected]": "https://outlook.office365.com/api/v1.0/Users('[email protected]')/Events('AAMkADRm...')" By using the value of the [email protected]
Influenced by project requirements and the range of preferences amongst members in my team, option 1 will serve us best at this stage. Conforming to the standard HTTP methods will simplify and clarify my API There will be a single, consistent approach to cloning a resource. This outweighs the issue...
I tried something, as I mentioned in the comments I pass the value through an API that searches for city details. Look at function getUkCountry(). That function tries out the four regions/countries of the UK. It works for the case you mentioned, it works for Westminster. I'm not really happy...
api,google-apps-script,gmail,quota
The Gmail API recently added push notifications via the google cloud pub/sub service. I wrote an example script on how to do this is Google Apps Script. You can view the code at: https://github.com/Spencer-Easton/Apps-Script-Gmail-Push-Notifications...
javascript,jquery,json,api,youtube
https://www.googleapis.com/youtube/v3/playlistItems only responses contentDetails with videoId, so you cannot retrieve the duration attribute. In your example, check again with this json...
You are sending the query parameter named field1 in the URL, but it is set to any empty string. Hence field1 is set to "" by thingspeak.com. Those values you pass in params are sent in the body of the HTTP POST request, they are not somehow appended to the...
ios,swift,api,model-view-controller,alamofire
Your loadAdInfo method is asynchronous. In the same way you're using a completionHandler to get Alamofire's data from adsForSection to loadInfo, you need to make an handler for loadInfo so you can retrieve the asynchronous response. Something like this: func loadAdInfo(section: String, page: Int, handler: (JSON) -> ()) { NWService.adsForSection(section,...
I am not quite sure where exactly you are struck , but please refer to the following document https://www.inboxsdk.com/docs/#ComposeView though it is documented in javascript
python,api,oauth,python-requests,yahoo-api
Change your body variable to a dict, i.e., body = { 'grant_type': 'authorization_code', 'redirect_uri': 'oob', 'code': '************', } No other changes are needed. Hope it helps....
android,api,google-maps,google-maps-api-3,reverse-geocoding
Make sure you have latest Google play library in your project. I am using this code and working for me. private class ReverseGeocodingTask extends AsyncTask<LatLng, Void, String> { Context mContext; public ReverseGeocodingTask(Context context) { super(); mContext = context; } // Finding address using reverse geocoding @Override protected String doInBackground(LatLng... params)...
The REST API doesn't support public folder access. EWS would be the way to go if you need PF access.
api,batch-processing,square,square-connect
From the Square docs: Note the following when using the Submit Batch endpoint: You cannot include more than 30 requests in a single batch. Recursive requests to the Submit Batch endpoint are not allowed (i.e., none of the requests included in a batch can itself be a request to this...
facebook,api,facebook-graph-api
The friends you see in the response have used the Graph API Explorer as well. In order for a person to show up in one person's friend list, both people must have decided to share their list of friends with your app and not disabled that permission during login. Also...
XDocument xml = XDocument.Parse(new WebClient().DownloadString("http://sporing.bring.no/sporing.xml?q=TESTPACKAGE-AT-PICKUPPOINT")); This will probably solve your problem. ...
java,android,api,android-studio,material-design
You can use limited features from material design in pre-lollipop versions. No Path Animations and such. Check out this link to see which features can be backported. http://android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html Although now it is appcompat-v22 which is the latest SDK released by Google....
try this code : don't forgot to include quick_func.php in your php code require_once('./quick_func.php'); // quick mp3 functions $url = "http://www.youtube.com/watch?v=qpgTC9MDx1o"; $exp = explode("?v=",$url); $vid = $exp[1]; $data = Convert_Vid($vid); // video id to convert $id = $data['id']; // get video id $title = $data['ttl']; // get video title $duration...
Try to put quotes on the array : foreach($json_a['list'] as $p) ...
python,json,api,rest,python-requests
Argh. That is a horribly designed API. The problem, as you noticed, is that they want parameters separated by semicolons. That means they are not part of the querystring at all, which is what requests does when you give it a params dict, but part of the actual URL path....
Initialize it without a context: NSEntityDescription *entity = [NSEntityDescription entityForName:@"MyEntity" inManagedObjectContext:myMOC]; NSManagedObject *unassociatedObject = [[NSManagedObject alloc] initWithEntity:entity insertIntoManagedObjectContext:nil]; Source: How to Deal with Temporary NSManagedObject instances?...
php,android,api,authentication,oauth
Yes, you are on the right track to some extent but let me suggest a way which is used in the industry for a while now. 1st read question and answer to get the basic idea of how it should be done. How to implement 'Token Based Authentication' securely for...
You can use the Color class which is an default android class. int rgb = Color.rgb(red, blue, green) it has static method rgb() which takes the red, blue and green colors and returns the mixed color....
Idempotency means that in an isolated environment multiple requests from a same client does not have any effect on the state of resource. If request from another client changes the state of the resource, than it does not break the idempotency principle. Although, if you really want to ensure that...
api,http-status-code-403,google-webmaster-tools,google-crawlers
I've found the solution. Just set the Scope to WebmastersService.Scope.Webmasters instead of WebmastersService.Scope.WebmastersReadonly string[] scopes = { WebmastersService.Scope.Webmasters }; UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = "clientId", ClientSecret = "clientSecret" } , scopes , "My Name" , CancellationToken.None).Result; ...
I think I can help. Disclaimer that I work for BlockTrail. It would not be good to use the same address because people can view the historical transactions associated with that address. It is recommended to use a new address for every transaction. These can be under the same wallet...
There is no permission called "read_inbox", and if you mean "read_mailbox", you may want to read this: This permission is granted to apps building a Facebook-branded client on platforms where Facebook is not already available. For example, Android and iOS apps will not be approved for this permission. In addition,...
Not sure if I understood your explanation. Here is my 2cents. I prefer to have separate controllers for API and he Web App. For couple of reasons: when you start to releasing the new versions you don't want to change the web app controller also you don't want to have...
There are several SHFILEOPSTRUCT.fFlags options you'll want to consider. You are asking for FOF_NOCONFIRMATION, &H10. You probably want some more, like FOF_ALLOWUNDO, FOF_SILENT, FOF_NOERRORUI, it isn't clear from the question. Check the docs.
javascript,api,web,timestamp,spotify
After getting an answer from spotify is seems it's currently not possible to get this information. "At the moment we are only exposing the release date of the album itself, not the date of addition to the Spotify index. We will take this into account as a feature request." https://developer.spotify.com/web-api/get-artists-albums/...
One major difference is that Java had exceptions, and exception handling, from the start. That means there is no need to return "SUCCESS". If it returns at all, rather than throwing an exception, it was successful. Java does not have pass-by-reference. What it does have is pointers. When you call...
ruby-on-rails,ruby,json,api,httparty
In fact, a quick google led me to this page https://app.enigma.io/api#data which tells me the parameter in question is limit, and that the max is 500. So, it looks like you can't get the data for all rows in one hit. If you really NEED the data for all the...
//Include the class. include "clusterdev.flipkart-api.php"; //Replace and with the correct values $flipkart = new \clusterdev\Flipkart("pratikson3", "853d3bc027514b3aa33f1caa4f30f1cf", "json"); $pid = "Flipkart Product ID"; $url = 'https://affiliate-api.flipkart.net/affiliate/product/json?id=' .$pid; //Call the API using the URL. $details = $flipkart->call_url($url); if(!$details){ echo 'Error: Could not retrieve products list.'; exit(); } //The response is expected...
You need to send HTTP headers: using (WebClient client = new WebClient()) { client.Headers.Add("Accept-Language", " en-US"); client.Headers.Add("Accept", "application/xml"); client.Headers.Add("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"); XDocument xml = XDocument.Parse(client.DownloadString("http://api.arbetsformedlingen.se/af/v0/platsannonser/matchning?lanid=1&kommunid=180&yrkesid=2419&1&antalrader=10000")); } ...
django,api,nginx,deployment,uwsgi
Security, what this is ultimately about, is and always has been a very complicated matter. The open internet is one of the most dangerous places. No matter how small and insignificant your server seems to be, people will find it and try to break it. If a web server is...
javascript,api,stream,soundcloud
Soundcloud's developer docs state that each playlist contains an array of tracks (see https://developers.soundcloud.com/docs/api/reference#playlists). You should be able to loop through the array and populate the html with the relevant values by effectively joining the code in your question together, though you will want to either use classes in the...
There is no way to access that API publicly any longer. You would need to apply to be part of their partner program to get access to those endpoints once again: https://developer.linkedin.com/partner-programs/apply...
Qualtrics provides a REST API: http://www.qualtrics.com/university/researchsuite/developer-tools/api-integration/qualtrics-rest-api/ You would use the API command getLegacyResponseData to get response data. You can use AJAX to call the API....
json,api,rest,api-design,hateoas
DO include absolute entity URIs in your responses (such as /customers/12 or even http://www.example.com/customers/12). DO NOT include just an entity's ID (such as 12) in a response, because that way you're forcing clients to put together resource URIs themselves. In order to do that, they would need to have prior...
php,json,api,zend-framework2,phpunit
I would strongly suggest trying to find the solution in rewriting your the code that returns your JSON string inside your controller. Using die to return a response object is not the way to go. An example on how to return JSON from your controller action could be as simple...
You can monitor battery level like so: UIDevice *device = [UIDevice currentDevice]; device.batteryMonitoringEnabled = YES; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(batteryChanged:) name:@"UIDeviceBatteryLevelDidChangeNotification" object:device]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(batteryChanged:) name:@"UIDeviceBatteryStateDidChangeNotification" object:device]; // Your notification handler - (void)batteryChanged:(NSNotification *)notification { UIDevice...
angularjs,codeigniter,api,rest,token
You can use an API key, however - as you wrote - it's pure protection and easily accessible value - potential abuser just needs to view the source or investigate the queries. In general REST APIs are secured with tokens. At the beginning of the session (not in traditional meaning...
The easiest way to get those variables in Javascript is to output them from PHP to JS, there is no direct bridge, so you will need in the HTML output a script block with the values you got from your SQL query, it will be something like this: <script> var...
django,api,rest,django-rest-framework
UPDATE is possible via 2 requests: PUT and PATCH PUT updates all the fields of the object on which the operation is to be performed. It basically iterates over all the fields and updates them one by one. Thus, if a required field is not found in the supplied data,...
There is an API call that you can make that tells you this, documented on LinkedIn's developer website at: https://developer.linkedin.com/docs/company-pages#is_admin Additionally, you can get a list of all companies that the member is an administrator of with this call: https://developer.linkedin.com/docs/company-pages#list_companies...
I think what you are looking for is: # ... text = articleFile.read().decode('utf-8') keyphrases = extractKeyphrases(text) # ... Basicly you want to decode to an unicode string the contents of the file as soon as you read it. Then the rest of your program is save from conversion problems. Please...
I think they want you to create a third-party library. Imagine you are schizophrenic for a while. Joe wants to build a Sinatra application to list some YouTube videos, but he is lazy and he does not want to do the dirty work, he just wants to drop something in,...
I am not sure if you did give out your real API key, but I urge you to change it ASAP. In any case, in Python, top level variables/names do not come from thin air - they're introduced either by import or the assignment statement (x = 123), (or some...
The default Content-Type in cURL is application/x-www-form-urlencoded. In Postman, you can just select the x-www-form-urlencoded button and start typing in your key value pairs, i.e. Key Value answers[][question_id] 1 For --header, there's a Headers button at the top right. When you click it, you will see fields to type in...
The API seems to return a JSON encoded string. So instead of: parse_str(curl_exec($ch), $parsed); use: $parsed = json_decode(curl_exec($ch), true); Then a print_r($parsed) will output: Array ( [success] => 1 [uses] => 154 ... ) And for checking success value: if ($parsed['success']) { // Do stuff } ...
wordpress,facebook,api,facebook-graph-api,facebook-apps
The API Key is the API ID. The API secret is the API secret. That theme is using legacy terminology....
django,api,rest,django-rest-framework,serializer
By default DRF will look at an attribute on the User model named after the serializer's field (member here). However the related name is profile. This can be worked around by passing the source="profile" to your MemberProfileSerializer....
xml,api,video,youtube,playlists
There is a PHP sample on the YouTube API site which uses the playlistItems.list call to get a list of videos which you can use to get the information you require. http://developers.google.com/youtube/v3/docs/playlistItems/list If you use the YouTube PHP client library then something along these lines will get all video IDs...
javascript,ruby-on-rails,api,rest,authentication
As long as you're using HTTPS then their password cannot be intercepted. Well.... it probably won't be intercepted. But the tactics that they would have to use in order to capture that password are somewhat out of your control. The user will have to be sure that they are actually...
I figured it must be a firewall problem but it took a while longer before I realised it was the firewall built into Linux. To make 2375 accessable: Use one of the following depending on your distro sudo firewall-cmd --zone=public --add-port=2375/tcp --permanent sudo firewall-cmd --reload OR sudo iptables -I INPUT...
Did you try to write the url like this: http://127.0.0.1:5000/api/v1/entity?where=section=='section32' please have a look at this python-eve.org/features.html#filtering...
You can use something like this to determine if a video exists: var url = "https://www.googleapis.com/youtube/v3/videos"; var videoId = "id={YOUR-VIDEO-ID}"; var apiKey = "key={YOUR-API-KEY}"; var part = "part=snippet"; $.get(url + "?" + apiKey + "&" + videoId + "&" + part, function(response) { alert(response.pageInfo.totalResults); }); response.pageInfo.totalResults will equal 0 if...
You are comparing your String to a TextView object instead of directly to the data. Try if( result.get(0).equals("weather") ) { ... } Or at least if( txtSpeechInput.getText().toString().equals("weather") ) { ... }...
Here's a working sample code from Spring Security OAuth github. https://github.com/spring-projects/spring-security-oauth/tree/master/tests/annotation/jwt You probably don't even need to mess with the filters as shown in the above example. If you've custom needs, please post some sample code....
javascript,api,google-api,cross-domain,referrer
Why your PHP script is failing: If you take a look at your error response from PHP: PHP Warning: file_get_contents(https://translate.google.com/translate_tts?ie=utf-8&q=the+brown+fox+jumped+over+the+lazy+dog) You'll notice that the url file_get_contents is requesting does not contain a tl parameter. This is causing a 404 to be returned. You can visit the page directly in your...
Your xml formation needs to be: $xml = '<xmlrequest> <username>admin</username> <usertoken>79fc84383811o000fggYYgsui41e5eb</usertoken> <requesttype>subscribers</requesttype> <requestmethod>AddSubscriberToList</requestmethod> <details> <emailaddress>'.$email. '</emailaddress> <mailinglist>10</mailinglist> <format>html</format> <confirmed>yes</confirmed> <customfields> <item>...
ios,swift,api,parsing,apple-watch
You can use a .plist file where you store all your important keys. It is very important to put this file into your .gitignore file. In your case, you need to set your keys.plist file like this: And use it inside your AppDelegate as follows: var keys: NSDictionary? if let...
Your code xml.Root.Descendants("platsannons").ToList()... gives an empty list. "platsannons" is the name of the root element you already have. Your code tries to find descendants with this name - and has to fail. It works if you replace it with xml.Root.Descendants().ToList()... ...
You're actually getting a json, change the following: client.Headers.Add("Accept", " text/html, application/xhtml+xml, */*"); to client.Headers.Add("Accept", "application/xml"); ...
javascript,ruby-on-rails,ruby,xml,api
Net::HTTP is Ruby's built in library for sending HTTP requests. Rails also has built in features for serializing models to XML. Lets say you bind your form to a User model: class User < ActiveModel::Base # attr_accessor is not needed if these are real DB columns. attr_accessor :firstname attr_accessor :surname...
This is in the spec in "Matching Requests to Resource Methods" Sort E using (1) the number of literal characters in each member as the primary key (descending order), (2) the number of capturing groups as a secondary key (descending order), (3) the number of capturing groups with non-default regular...
java,android,api,cloud,messaging
There's a working example at https://developers.google.com/cloud-messaging/android/start git clone https://github.com/googlesamples/google-services.git In there they do in RegistrationIntentService.java InstanceID instanceID = InstanceID.getInstance(this); String token = instanceID.getToken(getString(R.string.gcm_defaultSenderId), GoogleCloudMessaging.INSTANCE_ID_SCOPE, null); gcm_defaultSenderId is your project id (79424738XXXX) this is the RegistrationIntentService.this ...
api,twitter,timeline,tweets,home
You can not get more then 800 tweets in 1 go. But you can pass parameters like since_id and max_id: https://dev.twitter.com/rest/reference/get/statuses/home_timeline If you store the oldest tweet id => and in the next api call you pass in that id, then you will get the older ones. After that you...