I'm try using Spotify PHP api - php

I'm try to use api from
https://github.com/jwilsson/spotify-web-api-php/blob/main/docs/examples/access-token-with-authorization-code-flow.md.
Unfortunately, it doesn't work well because it gets such an error
Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIAuthException: Invalid redirect URI in D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php:56 Stack trace: #0 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php(244): SpotifyWebAPI\Request->handleResponseError('{"error":"inval...', 400) #1 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php(112): SpotifyWebAPI\Request->send('POST', 'https://account...', 'client_id=48f0c...', 'HTTP/2 400 \r\nda...') #2 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Session.php(250): SpotifyWebAPI\Request->account('POST', '/api/token', Array, Array) #3 D:\Software\Development\XAMPP\htdocs\spotif\auth\app\check.php(26): SpotifyWebAPI\Session->requestAccessToken('AQA9X84L0SDucXG...', 'a86937efa85589a...') #4 {main} thrown in D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php on line 56
I tried to solve the problem with all methods,but even if in the console of my Spotify application.
I have everything set up well, like the redirect URI in my PHP code, I still get an error.
Changing the redirectURI doesn't help me in any way.

Wait some hours/days fixing my problem

Related

Cloudinary AI background removal fatal error

I am trying to use Cloudinary AI background removal tool. This is the code I am using (Code snippet provided by Cloudinary)
if(isset($_POST["submit"])){
\Cloudinary\Uploader::upload("https://www.popwebdesign.net/popart_blog/wp-content/uploads/2019/05/slike-prirode-za-desktop-757.jpg",
array(
"public_id" => "dog_couch",
"background_removal" => "cloudinary_ai"
));
}
I get this error
Fatal error: Uncaught Error: Class 'Cloudinary\Error' not found in /storage/ssd5/884/7393884/public_html/Uploader.php:534 Stack trace: #0 /storage/ssd5/884/7393884/public_html/Uploader.php(408): Cloudinary\Uploader::call_api('upload', Array, Array, 'https://www.pop...') #1 /storage/ssd5/884/7393884/public_html/Uploader.php(101): Cloudinary\Uploader::call_cacheable_api('upload', Array, Array, 'https://www.pop...') #2 /storage/ssd5/884/7393884/public_html/index.php(13): Cloudinary\Uploader::upload('https://www.pop...', Array) #3 {main} thrown in /storage/ssd5/884/7393884/public_html/Uploader.php on line 534
When I use part just for uploading it works perfectly
if(isset($_POST["submit"])){
\Cloudinary\Uploader::upload("https://www.popwebdesign.net/popart_blog/wp-content/uploads/2019/05/slike-prirode-za-desktop-757.jpg");
}
as soon as I add array part I get the error. I can't see what I am doing wrong since this code is directly from cloudinary. I've found it here: https://cloudinary.com/documentation/cloudinary_ai_background_removal_addon
I have tried to search the internet, but could not find a solution for this.
Any help is appreciated!

Podio PHP Issue

Hello Everyone and Podio Development team, I have some issues in podio since few days, I integrate podio in client project and project is in PHP Codeigniter, The podio API's were working before perfectly, but now there are some issues i am getting error The path '/item/basic' was not found.." Request URL: http://api.podio.com/item/basic
Although to verify code, I already checked old codes which was also integrated in podio and they are also not working now since few days. I checked podio website for Podio Items: Get item basic
https://developers.podio.com/doc/items/get-basic-item-61768
this is deprecated but no alternatives are provided and I am getting error regarding this.
When i comment code of podio and website works but when i uncomment code of podio and run it it shows error since few days, I have tried all steps and cross check in case code mistake there is no mistake as same code was working before, old codes also i checked which worked before not worked now. Kindly help me thank you.
Attaching screenshots
Fatal error: Uncaught PodioNotFoundError: "No matching operation could be found. The path '/item/basic' was not found.." Request URL: http://api.podio.com/item/basic Stack Trace: #0 /home/username/public_html/podio-php-4.3.0/lib/Podio.php(351): Podio::request('GET', '/item//basic', Array, Array) #1 /home/username/public_html/podio-php-4.3.0/models/PodioItem.php(120): Podio::get('/item//basic', Array) #2 /home/username/public_html/st_application/controllers/user.php(1459): PodioItem::get_basic(NULL) #3 /home/username/public_html/st_application/controllers/user.php(901): User->podioPropertyCreate(336, Array, Array, Array, Array, '3 Females, 1 Ma...', 'uploads/files/', Array, 'jahanzeb#gmail....') #4 [internal function]: User->add_property('add') #5 /home/username/public_html/st_system/core/CodeIgniter.php(360): call_user_func_array(Array, Array) #6 /home/username/public_html/index.php(202): require_once('/home
/username...') #7 {main} thrown in /home/username/public_html/podio-php-4.3.0/lib/Podio.php on line 324
This is the issue image:
You are not passing the item_id with the API call.
For PodioItem::get_basic API call, the item_id parameter (first parameter) is required one.
Also, please note that this get_basic operation is deprecated and will be removed soon.
Please use Podio Get Item API instead.

PHP Fatal Error / Spotify Web Api

My script runs into an error - can someone help me on this? For me it looks like, that something is not okay with the username?
PHP Fatal error: Uncaught exception 'SpotifyWebAPI\\SpotifyWebAPIException' with message 'An unknown error occurred.' in /mnt/webp/b3/44/5462244/htdocs/SpotifyTest/src/Request.php:38
Stack trace:
#0 /mnt/webp/b3/44/5462244/htdocs/SpotifyTest/src/Request.php(188): SpotifyWebAPI\\Request->parseBody('<html><body><h1...', 400)
#3 /mnt/webp/b3/44/5462244/htdocs/SpotifyTest/testfile.php(68): SpotifyWebAPI\\SpotifyWebAPI->getUserPlaylist('lillabj\\xC3\\xB6rn', '0WXsElmPC8aEGzr...')
#4 {main}
thrown in /mnt/webp/b3/44/5462244/htdocs/SpotifyTest/src/Request.php on line 38
I think it is this line ->
SpotifyWebAPI->getUserPlaylist('**llabj\\xC3\\xB6rn**',.....
I get the username from a mysql table like this
$USERPL = $pl['user_name'];
Would be great if some can give me some help.
I think the problem is related to special characters in the username, the \\xC3\\xB6 part should be an "ö" so the full username is "lillabjörn".
When you run another user request with the same username in the Spotify Web API Console you can see that it's URL encoded in the actual request sent, https://developer.spotify.com/web-api/console/get-users-profile/?user_id=lillabj%C3%B6rn (click the link to see it).
Try URL encoding the username in all user related calls, for example:
$api->getUserPlaylist(urlencode('lillabjörn'), 'playlist_id');

Keep on getting error on website using AnchorCMS

I’m attempting to use AnchorCMS. I keep on getting this message at the bottom of my page.
Uncaught Exception
Undefined offset: 6
Origin
on line 90
Trace
#0 [internal function]: System\Error::shutdown()
#1 {main}
I’ve already tried deleting and reloading all files.
I also have the same problem as you. I tried to edit in Anchor/config/error.php report => true to report => false, but I’ve got a server error. Then I deleted the value (true or false), left it blank, and it succeed.

SoapClient in PHP throwing SoapFault exception: [HTTP] Forbidde

I am completely inexperience with this whole SOAP concept so I have no idea what to look for when I see an error.
So basically I am trying to pull some data from another company. That company gave me a digital certificate and and some xsd & wsdl files and asked me for my server's IP so they could whitelist it. As I mentioned, I have no idea what to do with the files they gave me, so I uploaded them to my server and then I started googling, and I have pasted together the following code (although I don't even know if it makes sense):
$protected_url = "http://www.myurl.com/WSDLFILE.wsdl";
$my_cert_file = "http://www.myurl.com/CERTFILE.pem";
$client = new SoapClient($protected_url, array('local_cert'=> $my_cert_file,'trace'=>1));
$params->Affiliate->AffiliateID = 555;
$params->Address->AddressLine = "123 Main Street";
$params->Contact = 'No';
$result = $client->QueryAddress($params);
And I get the following error
[10-Apr-2013 18:59:46 America/New_York] PHP Fatal error: Uncaught SoapFault exception: [HTTP] Forbidden in /home/mysite/index.php:15
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://secure....', 'http://www....', 1, 0)
#1 /home/mysite/index.php(15): SoapClient->__call('QueryAddress', Array)
#2 /home/mysite/index.php(15): SoapClient->QueryAddress(Object(stdClass))
#3 {main}
thrown in /home/mysite/index.php on line 15
It's kind of hard to search for help because I dont even know what I'm searching for, so any guidance is appreciated
EDIT: I should also add that I have actually been able to get a successful response by using cURL and setting the "CURLOPT_SSLCERT" option, but I need to use SOAP
(Answered in the comments. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
SOLVED: My problem was the way I was using the .wsdl file. I thought I had to upload the one they provided and then use it when creating the SoapClient, but that was not the case. What I needed to was reference their wsdl url, which ended in something like https:......asmx?WSDL

Categories