409 Conflict error with audio call - beatsmusic

I am testing the Beats api in the playground section of the developer site. When I try to use the Audio api call I get a 409 conflict error and the following response.
{
"code": "StreamContention",
"message": "Another device is currently playing music: web app"
}
I understand the error but the account is not logged in to the web app. I already logged out of the web app.
How can I fix this locking issue?

You're running into a stream contention issue. Since only one device is allowed to play audio at any time you must acquire the baton by passing the acquire param with value 1 to the playback endpoint.
ie. acquire=1
Check out this documentation for reference:
https://developer.beatsmusic.com/docs/read/tutorials/Stream_Contention
Hope this helps, thanks!

Related

What is https://i.instagram.com/api/v1

I am digging into Instagram APIs and find out a URL https://i.instagram.com/api/v1 which used by many git repos(some are recently updated) but when I go to Instagram there is no such url available there. Can anyone guide me what is the use of this url and how I can use it because when I hit
https://i.instagram.com/api/v1/accounts/login/
by POSTMAN i got below message
{
"message": "Your version of Instagram is out of date. Please upgrade your app to log in to Instagram.",
"status": "fail",
"error_type": "needs_upgrade"
}
One more thing. I am with my friend who work in android he has done reverse engineering on a app which use for increase followers and that app is also using same endpoints and working on that app.
It's November 2021, and somehow the API https://i.instagram.com/api/v1 still works, but I believe they have changed the way you use it.
NOTE: The given information is just for educational purposes
Let's take the user/{user_id}/info endpoint of this API, which returns basic information about the user_id.
The URL with this endpoint would be
https://i.instagram.com/api/v1/users/176702683/info/
If you paste this link into your browser you'll get the following message
{"message":"useragent mismatch","status":"fail"}
This means that API must be called via mobile user-agent. read more about user-agent here
We can solve this problem by providing a mobile user-agent string.
Using python requests library
!pip install requests
import requests
URL = https://i.instagram.com/api/v1/users/176702683/info/
headers = {'User-Agent':'Instagram 76.0.0.15.395 Android (24/7.0; 640dpi; 1440x2560; samsung; SM-G930F; herolte; samsungexynos8890; en_US; 138226743)'}
# samsung mobile user-agent
response = requests.get(url, headers=headers)
print(response.json())
Output:
{
"user": {
"username": "marcelotwelve",
"pk": 176702683,
"profile_pic_url": "https://instagram.fzrh3-1.fna.fbcdn.net/v/t51.2885-19/233796637_544571223333074_8761964745157634211_n.jpg?stp=dst-jpg_s150x150\\u0026_nc_ht=instagram.fzrh3-1.fna.fbcdn.net\\u0026_nc_cat=1\\u0026_nc_ohc=Cfk2kHCxgbIAX_vgNjn\\u0026edm=AEF8tYYBAAAA\\u0026ccb=7-5\\u0026oh=00_AT-tuXbAbsIkvmJqm_akQS__UPDtEXZxZChx2lO-9Wb0FQ\\u0026oe=62A8115E\\u0026_nc_sid=a9513d"
},
"status": "ok"
}
NOTE: Please be aware of how you use it
It is actually an API, that you can only use from your phone application, thats why it say it needs upgrade. you can download an addon for chrome / firefox to switch user agents, and after that you will be able to see the content.
It's worth checking there is lots of info about any user on insa
this response is a default error caused by having no cookie set
inspect instagram, you can see a redirect first (this way they fill initial cookies set for you). copy paste it to postman and try again

Heroku - Application Error, but no error in logs

I'm hacking away at a Facebook app on Heroku, using Node.js. When I go to the app myself, it works exactly as I expect. When I send another developer/tester to it, the standard Heroku "Application Error" message is displayed. When I check the logs, there isn't even a log that the developer made a GET request for the app page, let alone an error.
He tells me that the last thing he sees in his browser status bar is "waiting for .herokuapp.com", which implies that Facebook got to the app, but the logs don't support this theory.
Is there another method of seeing Heroku errors? Is there something I have to turn on in order to see more? A setting I have to modify to let this other guy use the app?
Update: Some more looking around led me to check the network traffic. He's getting a 503 Service Unavailable, followed by the error page. Still wondering why this happens on his machine, but not mine.
Update: Inserted some error-checking code into the handle_facebook_request method.
req.facebook.app(function(err, app) {
if(err !== null) {
var errorMessage = "Error getting app: " + util.inspect(err['error']);
console.log(errorMessage);
}
// rest of req.facebook.me, and rendering code
}
This gives me an "Unsupported get request", of type "GraphMethodException" and code 100. So now I have something I can look into! I wish that Heroku had at least mentioned that the request had been tried.
I had the same problem with a new facebook app created with the support heroku / node.js.
After several attempts and tests I saw that I get the message "Unsupported get request", type "GraphMethodException" and the code 100, because my facebook app was with sandbox mode.
When I disabled the sandbox my application on heroku it worked fine.

Error with Twitter link

Yesterday I started a new app on Facebook. Today I got the message that when people copy the link to Twitter they get an error. This is what you get:
{
"error": {
"message": "Unknown path components: /your_namespace:your_action",
"type": "OAuthException",
"code": 2500
}
}
What does this mean? What could be the problem?
Are you actually sending the POST action link to Twitter? Why?
I think you misunderstood how Open Graph works. Basically, you should be the one publishing actions when users take an action using your service. You can use a server-side or a client-side language to POST request (when you click a link, your browser actually makes a GET request, not a POST) to https://graph.facebook.com/me/namespace:action?access_token=ACCESS_TOKEN&OBJECT_PATH=OBJECT_URL
Note that you need to create an app, use it to authenticate users to get the access token and also set your custom actions / objects. These will need to be approved before you can actually use them.
You should start by taking a look at the sample apps to see how they work: https://developers.facebook.com/docs/samples/

"message": "Invalid redirect_uri:"

So a few months ago my facebook app worked, and now I get a:
{ "error": { "type": "OAuthException", "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration." }
So I googled about that, and read that the cause might be that I didn't specify a site domain in the app settings. So I did that, but Facebook told me that this won't work unless I also specified a website or mobile device adress. But up to now I had this just set as App and neither Website nor mobile thingy. So now I also have to check "website" in addition to "application?" This is confusing.
Anyway, so I thought "whatever" and set it also as website in the app settings. But I still get the same error.
I read something about a channel file? So I have to create one of those or something?
I'm lost and thankful for any advice.
This error is almost always when you're trying to redirect the user to a URL other than your app or website, check that you're actually redirecting them to the correct place

iphone twitter and sharing

Has anyone encountered the following error message when sending to Twitter?
"Error: Incorrect signature"
And on the debug console:
<0xf14cf80 SHKTwitter.m:(356)> Twitter Send Status Error: {"request":"\/1\/statuses\/update.json","error":"Incorrect signature"}
So far as I can tell I've followed the install instructions on http://www.getsharekit.com/install/#download and it is working with Facebook, e-mail etc. just not Twitter.
It would be great if someone has seen this error before and goes "aha!".
All I did to enable twitter Sharing is:
Regitered my App as a Twitter APP (Application Type: Browser)
#define SHKTwitterConsumerKey #"My..."
#define SHKTwitterSecret #"My..."
#define SHKTwitterCallbackUrl #"http://www.anything.com/callback" // You need to set this if using OAuth, see note above (xAuth users can skip it)
\#define SHKTwitterUseXAuth 0 // To use xAuth, set to 1
\#define SHKTwitterUsername #"" // Enter your app's twitter account if you'dlike to ask the user to follow it when logging in. (Only for xAuth)
Note that for the callback function you can enter any URL you want. even www.google.com. Just make sure it is the same URL in your code.
The issue is that you're signed into your twitter account, and allowed the app to connect to your profile.
However, days go by, the Key and Secret change, and now you're seeing this error. It's because you have to log out and re-log back into Twitter. I spent waaay too much time finding this out when I created a new Twitter App to hook into (and organize my apps) and found this error.
Basically, ShareKit is saving your login info, auto-logging you in, and getting the error when twitter says the app doesn't have permission to connect to your profile.
Follow these steps to log yourself out and test again :
http://www.getsharekit.com/docs/#logout
Check this previous SO question, it might be able to help you solve the problem:
Twitter API status update always returns "Incorrect signature"