Tracks for "The Hives" claims to be streamable, but are returning 404s.
Here's the JSON response for Civilization's Dying id 3644317 (http://api.soundcloud.com/tracks/3644317.json?client_id=):
{
"kind": "track",
"id": 3644317,
…
"sharing": "public",
"streamable": true,
"embeddable_by": "all",
"downloadable": false,
"title": "Civilization's Dying",
…
"stream_url": "http://api.soundcloud.com/tracks/3644317/stream"
}
the streamable is true and it gives a stream_url, when trying to access it with my client_id (like I've done with other tracks) it returns 404.
Edit: Sharing is public. Added the info back to the payload and a link to the api page with the full response for reference.
There's currently a bug affecting some artists whose tracks are not actually streamable any more, but the API response not showing that fact. This should be fixed very shortly.
Make sure this song has "sharing" set to "public" in the returned track get request. If not, you will need to authenticate with Soundcloud.
http://developers.soundcloud.com/docs#authentication
I encountered this issue as well when I tried to stream Lorde's (Royals) tracks. (Soundcloud userid: 27622444)
After examining the track properties returned from the API I noticed that the streamable property had been set to false
API return data:
(...)
sharing: "public"
state: "finished"
streamable: false
tag_list: ""
title: "Swingin' Party"
(...)
Hope that helps!
Cheers,
T
Related
Problem Statement:
I have 3 objects (screen below). Each object has a box trigger as part of the Blueprint. When the player overlaps the trigger, I want to POST to a Postman API Mock server on an ActorBeginOverlap event to change a boolean value from true to false.
What I'm trying to Achieve:
I have successfully created a GET request to determine if the objects should be visible or not onBeginPlay depending on the JSON value in Postman. I need to now create a POST event on the box trigger to change the value from TRUE to FALSE.
Where I'm running into problems:
I'm new to Postman and vaREST so I pretty much don't know what I'm really doing and rely heavily on online tutorials. The GET request seems to have a lot of examples online but POSTS are pretty limited. I need help getting a POST to work.
JSON Body on Postman:
{
"id": 8675309,
"objectives": [
{
"obj1": true,
"obj2": false,
"obj3": true
}
],
"questComplete": true,
"reward": false
}
When Played:
GET Blueprint - Working Properly
POST Blueprint - Don't know what I'm really doing here...
I'm trying to figure out if I'm doing something wrong, or if GoDaddy is just returning bad results.
When I check the domain availability on their API sandbox, domains show up as "true" or available.
But then, when I check on the front end of GoDaddy, they show as "taken"
For example, if I use the following get request, GoDaddy API returns as "available"
https://api.ote-godaddy.com/v1/domains/available?domain=facebookchat.com&checkType=FAST&forTransfer=false
Returned JSON
{
"available": true,
"currency": "USD",
"definitive": true,
"domain": "facebookchat.com",
"period": 1,
"price": 7490000
}
But if I check on the front end here, it comes back as "taken"
https://www.godaddy.com/domainsearch/find?checkAvail=1&tmskey=&domainToCheck=facebookchat.com
Photo from official API showing domain available:
Front end results showing domain NOT available:
I would guess that you're using the test environment and that's why you get different results than their website. The OTE is probably a snapshot of the real database at some point and they just kept it that way thus the resulting difference. Try to switch to the production environment and compare results again.
Another side of this is the definitive variable returned by the availability check API call. The documentation vaguely states "Whether or not the available answer has been definitively verified with the registry" as clarification for the said variable.
Edit: you're definitely using the test environment, just saw the URI on your screenshot.
I'd say their API is unreliable. I just tested it for domain=getpostman.com and it reports "available": true even though it most certainly is not.
{
"available": true,
"currency": "USD",
"definitive": true,
"domain": "getpostman.com",
"period": 1,
"price": 10690000
}
According to the docs, the "available" and "definitive" values are supposed to indicate that they are absolutely sure about whether or not the domain name is available.
DomainAvailableResponse
available* boolean Whether or not the domain name is available
definitive* boolean Whether or not the available answer has been definitively verified with the registry
The HTTP/1.1 standard states that if a POST operation results in the creation of a resource, then the response should include a Location header with the address of the new resource.
If a resource has been created on the origin server, the response
SHOULD be 201 (Created) and contain an entity which describes the
status of the request and refers to the new resource, and a Location
header (see section 14.30).
and in section 14.30,
For 201 (Created) responses, the Location is that of the new resource
which was created by the request.
Now suppose that my API allows batch creation of resources by POSTing an array to the collection resource URL. For example:
POST /books
[
{
"name": "The Colour of Magic",
"published": "1983"
},
{
"name": "The Light Fantastic",
"published": "1986"
}
]
Since two \book\{bookId} resources have been created, what should be the value of the Location header in this case?
The question Http post response after multiple new resource creation? is similar, but it asks about the response entity, not the headers (and is unanswered).
RFC 2616 is obsolete. Stop looking at it except for historical purposes.
The current spec, RFC 7231, says:
"If one or more resources has been created on the origin server as a result of successfully processing a POST request, the origin server SHOULD send a 201 (Created) response containing a Location header field that provides an identifier for the primary resource created (Section 7.1.2) and a representation that describes the status of the request while referring to the new resource(s)." -- http://greenbytes.de/tech/webdav/rfc7231.html#POST
And yes, that doesn't help a lot when there isn't a "primary" resource.
I know this answer is late to the party but I believe the best solution is to create a new "Batches" resource with a uuid identifier that would return the list of Book URLs that were added using a URL like this:
http://api.example.com/batches/{uuid}
e.g.
http://api.example.com/batches/2b9b251f71a4b2901d66e04725bc0c9cb5843c74
Then your POST or PUT can return the above URL on it's Location: {url} header and a 201 - Created status code.
If you then GET that URL that resource should respond with a representation that lists the URLs created in that batch, as well as any other info about the batch such as its uuid and the time/date it was created.
{
"uuid": "2b9b251f71a4b2901d66e04725bc0c9cb5843c74",
"datetime": "2005-08-15T15:52:01+00:00",
"books": [
"http://api.example.com/books/the-colour-of-magic",
"http://api.example.com/books/the-light-fantastic"
]
}
Those resources could then have a TTL of an hour or a month, whatever you choose. Or they could live forever if you want; whatever your use-case requires.
I think that you are in a particular use case for the header Location. In the case of bulk creation, the result of the processing is generally provided within the returned content itself. As a matter of fact, the processing can be completely or partially successful. I mean all elements were added or only a subset and the result shows to the end-user what actually happens.
So I think that the header Location isn't usable in such context. I see two options for the status code:
The status code is 201 if at least one element is created)
The status code is 200 to tell that the bulk request globally succeeds but the result of each operation is described in the response content.
You can however notice that a status code 202 exists if your resource handles the bulk creations in an asynchronous way. But in the context, you need then to pull a resource to get the status of the inserts.
Regarding the content of the response, you are free to choose. We could imagine something like that:
{
"took": 4,
"errors": true | false,
"items": [
{ "added": true,
"error": null
"id": "123"
},
{ "added": false,
"error": {
"code": "err12",
"description": "validation error (field type, ...)"
}
"id": null
}
]
}
ElasticSearch provides such bulk api with create but also update and delete support - see this link for more details: http://www.elastic.co/guide/en/elasticsearch/guide/current/bulk.html.
Here are similar questions that could give some hints:
How to Update a REST Resource Collection
REST API - Bulk Create or Update in single request
Hope it helps you,
Thierry
I am trying to paginate the track list of a set/playlist obtained via soundcloud JSON API. Pagination technique described here works fine if I want to generate tracklist of x number of tracks for next page only. What I am trying to do is to make a numbered pagination with multiple page links. I didn't find any parameter such as "track_count" which returns the total number of tracks for "/user/tracks". So, can anyone give me any insights on making a numbered pagination for a playlist when getting data via soundcloud JSON API? thanks
/users endpoint has "track_count" property in the returned representation of user:
$ curl "http://api.soundcloud.com/users/3207.json?client_id=YOUR_CLIENT_ID"
{
"id": 3207,
"permalink": "jwagener",
"username": "Johannes Wagener",
"uri": "http://api.soundcloud.com/users/3207",
"permalink_url": "http://soundcloud.com/jwagener",
"avatar_url": "http://i1.sndcdn.com/avatars-000001552142-pbw8yd-large.jpg?142a848",
"country": "Germany",
"full_name": "Johannes Wagener",
"city": "Berlin",
"description": "<b>Hacker at SoundCloud</b>\r\n\r\nSome of my recent Hacks:\r\n\r\nsoundiverse.com \r\nbrowse recordings with the FiRe app by artwork\r\n\r\ntopbillin.com \r\nfind people to follow on SoundCloud\r\n\r\nchatter.fm \r\nget your account hooked up with a voicebox\r\n\r\nrecbutton.com \r\nrecord straight to your soundcloud account",
"discogs_name": null,
"myspace_name": null,
"website": "http://johannes.wagener.cc",
"website_title": "johannes.wagener.cc",
"online": true,
"track_count": 12,
"playlist_count": 1,
"followers_count": 417,
"followings_count": 174,
"public_favorites_count": 26
}
This question is already old, but I hope this could help other people.
You could use either of this endpoint:
http://api.soundcloud.com/playlists/{playlist_id}?client_id={client_id}
https://api.soundcloud.com/playlists/{playlist_id}?oauth_token={oauth_token}
The 2nd API is undocumented, the first endpoint suddenly started to return 401 for no reason which is from the SoundCloud API documentation. I still provided the 1st endpoint as it's only not working at work, but behaves correctly at home IP address. I suggest if you'd use the 2nd API to generate and use a non-expiring token.
SoundCloud is not a reliable provider anymore as there's no app support for developers. You just have to figure things out by yourself.
On the JSON response, look for track_count. That'll give you the number of tracks in a playlist.
Hitting URL #1 (https://graph.facebook.com/280518352029215) associated to this REAL url (http://www.sephora.com/rose-h-cream-P224527) in a browser CORRECTLY outputs this:
{
about: "What it is:A rich hand moisturizer.What it is formulated to do:Jurlique's Rose Hand Cream deeply hydrates the hands, restoring a soft, supple feeling.What it is formulated WITHOUT:- Parabens- Synthetic Fragrances- Synthetic Dyes- Petro-ChemicalsWhat",
category: "Product/service",
description: "What it is:A rich hand moisturizer.What it is formulated to do:Jurlique's Rose Hand Cream deeply hydrates the hands, restoring a soft, supple feeling.What it is formulated WITHOUT:- Parabens- Synthetic Fragrances- Synthetic Dyes- Petro-ChemicalsWhat",
is_published: true,
talking_about_count: 0,
were_here_count: 0,
id: "280518352029215",
name: "Sephora: Rose Hand Cream : hands-feet-bath-body",
link: "http://www.sephora.com/rose-h-cream-P224527",
likes: 1
}
URL #2 (https://graph.facebook.com/541777132555995) associated to (http://www.sephora.com/green-tea-oil-control-mask-P379853) has a completely different response even though open graph meta tags are identical to URL #1. This is the response:
error: {
message: "An access token is required to request this resource.",
type: "OAuthException",
code: 104
}
additionally, even using an access token I still get this response:
https://graph.facebook.com/541777132555995?access_token=158904350882249|753f74bda2299df3758d21708c7ba34c
error: {
message: "Unsupported get request.",
type: "GraphMethodException",
code: 100
}
I need URL #2 to have a response like URL #1... with or without an access token, I just need a response similar to URL #1. Both URL's are coming from the same website and app where their meta tags are programmatically generated, thus I don't see why FB could successfully consume URL #1, but not URL #2... please help!
Thanks
Well, I think we cannot help you without the real url of the object, so as to see what it is!
Have you try both url (the real ones) in facebook debugger: https://developers.facebook.com/tools/debug
to see the difference?