Fix for BILLING_TRANSACTION_ERROR using Google Survey API - google-surveys

I'm using the Google API client library for PHP to create Google Surveys. I'm able to create surveys, but not start them. The error I receive is:
Array ( [0] => Array ( [domain] => global [reason] => BILLING_TRANSACTION_ERROR [message] => Billing Transaction Error: Current user is not configured for post-payment..
I've set up a billing account # https://console.cloud.google.com/billing and see my project linked to the account, but am still getting this error.
Any help would be appreciated!

I'm on the Google Surveys team. To start and stop surveys with the API, you'll need to have an established sales relationship with us. Please email surveys-api#google.com for more information on getting set up with that.

Related

Outlook webhook notification subscription

I already implemented outlook notification rest api into my code and its work fine but today it suddenly failed and gives me 400 error.
Request outlook for create subscription for notification
Output::
{"error":{"code":"ErrorInvalidParameter","message":"The parameter 'Resource' is invalid."}}
My post data as below ::
URL => outlook.office.com/api/v2.0/me/subscriptions
$subscriptionParameters = json_encode(array(
"#odata.type" => "#Microsoft.OutlookServices.PushSubscription",
"Resource" => "https://outlook.office.com/api/v2.0/me/events",
"NotificationURL" => "https://mydomain/acceptnotification.php",
"ChangeType" => "Created, Updated, Deleted",
"ClientState" => "c75831bd-fad3-4191-9a66-280a48528679"
));
Pass above data to outlook with access_token and email address using cUrl
Please suggest me.
Thank you for reporting this issue. Microsoft engineering team is investigating it right now. Meanwhile, a workaround that worked for multiple subscription cases is to use relative URL for the resource property
e.g.
"Resource": "me/events",
Thanks.

How to properly get LinkedIn company updates using the API?

I cant seem to get a proper return of company updates (shares) via the LinkedIn API: https://developer.linkedin.com/reading-company-shares
When I make a request for company updates with event type "new-hire" of lets say The Coca Cola company my endpoint is:
api.linkedin.com/v1/companies/1694/updates?event-type=new-hire
This gives me a result of 0
[#attributes] => Array
(
[total] => 0
)
However when making a request for company updates with event type "status update" my endpoint is:
api.linkedin.com/v1/companies/1694/updates?event-type=status-update
This gives no result but a status 500 API sever error.
[status] => 500
[timestamp] => 1390384395039
[request-id] => 2O14IFML4X
[error-code] => 0
[message] => Internal API server error
Am I doing something wrong? Is my API endpoint not correct? Or is this a LinkedIn API bug. I've found posts of other developers having similar problems.
You need to use oauth2_access_token to get data like this https://api.linkedin.com/v1/companies/id/updates?oauth2_access_token=access_token&format=json&event-type=job-posting&count=250

Is there a programmatic interface for retrieving/exporting Report results from Salesforce?

I am trying to retrieve the results of a Salesforce Report programmatically.
Often referenced is this blog about scraping the results from the web side, but the method is unsupported: http://sfdc-heretic.warped-minds.com/2006/04/10/progmatic-access-to-salesforcecom-reports/.
I can get a list of reports via the REST api:
require 'restforce'
restforce_client = Restforce.new(
:refresh_token => <refresh token>,
:client_id => <client id>,
:client_secret => <client secret>
)
reports = restforce.query("SELECT Id,DeveloperName FROM Report")
reports.last.DeveloperName
=> "Rob_Test_Report"
I've also tried retrieving via the Metadata SOAP API ReportFolder object:
require 'metaforce'
metaforce = Metaforce.new(
:username => <username>,
:password => <password>,
:security_token => <security token>
)
report_folders = metaforce.list_metadata('ReportFolder')
report_folders.last.full_name
=> "RobTestReportFolder"
I can see the folder. I haven't retrieved the contents yet but even when I do it seems that I would just be getting the metadata around the report itself (i.e. the filter criteria), not the results of the report. The metadata api is discussed here: https://success.salesforce.com/questiondetail?qId=a1X30000000IQ8pEAG. Is this correct?
I saw this similar question from a couple years ago but did not know if it was correct or anything had changed in the API:
How to I access reports programmatically in SalesForce using Apex
Is it possible to export or pull the results of a Report through a supported Salesforce API?
You cannot retrieve the results of a report without using the Analytics API, which as of the Summer '13 release will be available only as a pilot. If you want to participate in the pilot, let me know and I will submit your request.
Once in the Pilot, you use a REST endpoint passing in the Id of the report. You will have two endpoints-- a describereport endpoint and a runreport enndpoint. What is returned from describeReport is a JSON representation of the metadata for the report (describes the dimensions and facts and such) and from runReport a JSON representation of the data.
Once you have the data you can do with it what you will. The report data is only available at the summary level and for the pilot only summary and matrix reports are supported.
I'm not aware of any programmatic way to do that. Conga app could be one option but I believe they get the filters from the report's metadata and construct a matching SOQL query...
The blog post you've mentioned should work. You probably missing something like setting session id in cookie.
Hack, error-prone, web-scraping way would be to use something similar to trick I did with Apex: https://salesforce.stackexchange.com/questions/4303/scheduled-reports-as-attachment. Theoretically you'd be able to pull off similar thing from any other API access as long as you have the user's session Id (whether passed from logged in session or generated yourself from SOAP login call...)
Do also check out metadaddy's answer to my related question: https://salesforce.stackexchange.com/questions/4692/screen-scrape-salesforce-with-rest-get-call-from-apex

How to create test account with PayPal Payments Pro (Use to represent yourself as a merchant using Pro) option selected in sandbox?

I am unable to create Paypal sandbox test account with option PayPal Payments Pro (Use to represent yourself as a merchant using Pro). I selected the option during test account creation but when I viewed the details of that account, then it displayed
Account Type : Seller (Use to represent yourself as the merchant).
Please help me as I am unable to do credit card payment integration using sandbox as it is showing
error :
Array
(
[TIMESTAMP] => 2013-02-06T10:40:57Z
[CORRELATIONID] => 2732f8af3ec70
[ACK] => Failure
[VERSION] => 85.0
[BUILD] => 5060305
[L_ERRORCODE0] => 10501
[L_SHORTMESSAGE0] => Invalid Configuration
[L_LONGMESSAGE0] => This transaction cannot be processed due to an invalid merchant configuration.
[L_SEVERITYCODE0] => Error
[AMT] => 100.00
[CURRENCYCODE] => USD
)
Thanks in advance.
The API credentials in the Sandbox environment uses the default buyer account you have. You need to make sure to use the “payments pro” option when you create a buyer account in the sandbox environment. You’ll then see a new set of API credentials under API credentials…
Steps below:
Go to the link https://developer.paypal.com/us/cgi-bin/devscr?cmd=_sandbox-acct-session and login with your sandbox credentials
And click on the link Preconfigured which will take you to https://developer.paypal.com/us/cgi-bin/devscr?cmd=_create-account-session
From the options select Website Payments Pro (Use to represent yourself as a merchant using Pro) and create a Test Account and use these details for sandbox

Magento API Data Type: CartCustomerEntity

While trying to create a cart via the Magento API, I am having trouble adding an existing user as the owner of the cart. I am working with the documentation they provide here:
http://www.magentocommerce.com/wiki/doc/webservices-api/api/cart#cart_customer.set
I called "customer.info" using my specific customerId, then just passed the results to that cart_customer.set method, praying that was what it was asking for. It returned (from PHP)
Fatal error: Uncaught SoapFault exception: [1045] Customer's mode is unknown in ...
I looked at the example at the bottom of the above referenced page and they only had an example for a new guest user, 'mode' set to 'guest'. I was wondering if anyone knew what the other options were for that 'mode' key? Documentation on that data structure in general would be a great help.
Thanks.
Via my own comment:
Ah ha! Found buried in their forum:
$customer = array( 'entity_id' => 6, 'mode' => 'customer' ); via http://www.magentocommerce.com/boards/viewthread/232778 I guess that is all you need to pass. This isn't really a great explanation but it does solve the original problem.
Just gonna flag this one as done.