PHP - Zenfolio API - Error for method LoadGroupHierarchy - php

I am trying to bring photos from Zenfolio database using PHP. I keep receiving this error
Zenfolio API Error for method LoadGroupHierarchy: E_NOSUCHOBJECT (Error Code: 90009)
I am using admin username and password. Any ideas why?

Related

imap_open custom error callback

I want to build an authentication system for a website using IMAP. Users should be able to log in with the same credentials as the email account.
Everthing works fine, except if the input data is wrong or didn't match with the email account credentials. If so, there is obviously an error...
imap_open(): Couldn't open stream {domain.com:993/imap/ssl}INBOX
Is there any way to set an custom callback if the imap_open() fails? (Like redirect back with error message, ...)
This is warning level message so you should be able to use error handler, for example:
set_error_handler(function() { /* this will be executed on error */ });
imap_open();
restore_error_handler();
Here is similar question: https://stackoverflow.com/a/1241751/3470670
Here you can find complete documentation about setting custom error handler http://php.net/manual/en/function.set-error-handler.php

PayPal-PHP-SDK code errors

I am using Paypal-PHP. SDK, a I want to get code errors. When I put wrong credit card data, I am getting this JSON as answer:
{
"name":"CREDIT_CARD_REFUSED",
"message":"Credit card was refused",
"information_link":"https://developer.paypal.com/webapps/developer/docs/api /#CREDIT_CARD_REFUSED",
"debug_id":"63a9cf220d272"
}
or this:
{"name":"VALIDATION_ERROR",
"details":[
{"field":"payer.funding_instruments[0].credit_card.expire_month","issue":"Must not be blank"},
{"field":"payer.funding_instruments[0].credit_card.expire_year","issue":"Must not be blank"},
{"field":"payer.funding_instruments[0].credit_card.cvv2","issue":"Must be numeric"}],
"message":"Invalid request - see details","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR","debug_id":"8e61a15a1bf4a"}
But I need error code. How Can I get it?
Thanks
REST API usually do not return error codes like classic API. There are no error codes associated with the error message.
It just returns the error object with name debug_id message information_link details

Fatal error: Uncaught GraphMethodException in base_facebook.php

I am using the Facebook PHP SDK V3.2.3 and have built a web based app which simply gets users albums and pics and displays them on our site after the user authorises themselves.
I have tested the site functionality on different machines on different browsers/networks and everything works as expected from our side. We can authorise as the developers set on the account as well as the test user and authorise and see the pics/albums, problem free.
I submitted the app for review and it was denied - these are the notes returned.
When I click on the Facebook button, I receive the following error message,
" Fatal error: Uncaught GraphMethodException: Unsupported get request. thrown in
/home/websitename/public_html/sitedir/src/base_facebook.php
on line 1325."
Has anybody else had this issue? I am am completely at a loss as I can't debug this as I cannot recreate the problem.
It looks like you are trying to access something in your code that you do not have access to, or something that doesn't exist.
You should always wrap your Facebook API code in try...catch statements to catch any issues and fail gracefully.
try {
// some Facebook API call
} catch ( Exception $e ) {
// an error occurred
echo $e->getMessage();
}

Magento api cart_coupon.add does not work

I am creating Android app that allows user to add product into his shopping cart and places order.
I am using XMLRPC for this purpose.
Following steps I have done
1.cart.create
2.cart_customer.set
3.cart_customer.addresses
4.cart_shipping.list
5.cart_shipping.method
6.cart_product.add
7.cart_payment.list
8.cart_payment.method
All code works fine till cart_payment.method , but when I call cart_coupon.add api I get exception
org.xmlpull.v1.XmlPullParserException: expected: START_TAG {null}methodResponse
(position:START_TAG (empty) <br>#1:7 in java.io.InputStreamReader#4151b450)
at org.kxml2.io.KXmlParser.require(KXmlParser.java:2046)
My code is:
client = new XMLRPCClient(url);
object = client.callEx("call", new Object[]{sessionId,
"cart_coupon.add",new Object[]{shoppingCardId,couponcode}});
where url is valid magento host url,shoppingCardId is CardId that I get from server.
Exception is at class XMLRPCClient, at line
pullParser.require(XmlPullParser.START_TAG, null, Tag.METHOD_RESPONSE);
I think server replies with blank string and parser doesn't find start tag.
If I call same api through php script, cart_coupon.add and cart.order work fine and I get order id in response and
at server side in sales->orders , I can see order has been placed successfully.
But when I follow same procedure from Android I get Exception described above.
What should I do?
I also got same problem. I bypassed XMLRPC for last call and written php script to place order.

Google Calendar API causing HTTP Error 500

I'm using the new Google Calendar API v3. I'm trying to obtain the users calendar list using the PHP library. If I make the request directly using CURL then it works fine, but for some reason when I try and use the PHP library it fails and throws a 500 error.
Here's the (abbreviated) code:
$this->calendarAPI = new apiCalendarService($this->client);
$calendar_list = $this->calendarAPI->calendarList->list();
If I var_dump the contents of $this->calendarAPI->calendarList then I get an object as I would expect. It's only when I call the list method that everything goes wrong.
Can anyone help or am I going to have to write my own library and interact with the API protocol directly?
Ok, so it turns out this is a mistake in the docs. Instead of calling a method called list() you have to call listCalendarList() so the second line should be:
$calendar_list = $this->calendarAPI->calendarList->listCalendarList();

Categories