Fetch Report using GoodData API - php

I have created a report on my GoodData UI. Now I want to fetch this report using the API. I spent hours digging the API docs but I am unable to find a simple way to do so.
If I try gdc/execute/raw/, it returns
[error] => Array
(
[parameters] => Array
(
[0] => execute
)
[requestId] => 53fPgKcFdkjf8PZ5:4n6x9lp9vk3ydbvs
[component] => GDC
[errorClass] => GDC::Exception::NotFound
[message] => resource %s not found
)
If I try gdc/xtab2/executor3 it returns
[error] => Array
(
[parameters] => Array
(
[0] => report_req
[1] => STRUCTURE INVALID - name of structure:'ReportReq'(tag:report_req), /report_req/ExecutionObject: Object does not match any alternative. Alternatives tried : [STRUCTURE INVALID - name of structure:'ReportReq' ...]
)
[requestId] => a0yRpNUpCPRsbPS0:6nagmwaw61h5g2bn
[component] => Apache::REST
[errorClass] => GDC::Exception::User
[message] => Checking '%s', result %s
)

Your requests got 404 and 400 statuses respectively.
When you tried to use 'gdc/execute/raw/' the call that reached our side was: "request="POST /gdc/execute/raw/ HTTP/1.1"", instead of that it should look like "POST /gdc/app/projects/{your_project_id}/execute/raw/ HTTP/1.1", that's the reason your are getting a 'NotFound' error. Regarding 'gdc/xtab2/executor3' there's apparently something wrong within the body of the call.
Please post your calls here, their bodies and how exactly you are making them, or open a support ticket with those details at https://support.gooddata.com/home so that we can investigate further.

Ultimately I followed this code piece https://gist.github.com/gnilrets/b9d2ce9890d8aaa07042
Much better than reading the whole GoodData API documentation.

Related

How do i provide the PriceBook2Id on Order object using Sales Force phptoolkit?

I'm using PHP Toolkit for Sales Force, and it's been working great, except when i try to Create an order.
The error i receive is:
[message] => Order: bad field names on insert/update call: Pricebook2Id
Where my object field and value are:
$orderObj->Pricebook2Id = '01s4T0000027uumQAA';
---- EDIT
For those imagining the ID is wrong, when i query for pricelists on Sales Force, i receive the following in the response:
[1] => stdClass Object
(
[Id] => 01s4T0000027uumQAA
[CreatedById] => 0054T000000tM8jQAE
[CreatedDate] => 2020-02-10T15:03:33.000Z
[Description] => Produtos Scientific
[IsActive] => 1
[IsDeleted] =>
[IsStandard] =>
[LastModifiedById] => 0054T000000tM8jQAE
[LastModifiedDate] => 2020-02-10T15:19:20.000Z
[Name] => Produtos SST
[SystemModstamp] => 2020-02-10T15:19:20.000Z
)
There's no information anywhere about this problem, has anyone faced this before?
Turn out this isn't a code or permission problem, it's a validation problem from the WSDL.
If you find yourself in this kind of error with Sales Force, generate and update your WSDL as stated in:
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_steps_generate_wsdl.htm
This should solve your field differences problems.
At leats it did for me. Thanks for all that looked in this question. Hope it helps.

Laravel one way communication

I want laravel backend to send a message to my Ionic App whenever there is an entry in my database. I don't want to do polling at frontend, found this library rukavina/kurento-client-php
(https://github.com/rukavina/kurento-client-php) but unable to get any success as I was getting this error.
Array (
[code] => 40201
[data] => Array (
[type] => SDP_PARSE_ERROR
)
[message] => Empty offer not valid
)
Can anyone help me who either implemented kurento-client-php library or worked on similar situation.
Finally did it using Laravel-ratchet and php-zmq.

Is it possible to call rest API using PHP, inside GAE for putting data at pull queue?

Is it possible to call rest API using PHP, inside GAE for putting data at pull queue ??
I am trying to call rest api to put data at pull queue but I get an error
Array
(
[error] => Array
(
[errors] => Array
(
[0] => Array
(
[domain] => global
[reason] => forbidden
[message] => you are not allowed to make this api call
)
)
[code] => 403
[message] => you are not allowed to make this api call
)
)
You might want to try my PHP Pull Queue library for App Engine.
https://github.com/tomwalder/php-appengine-pull-queue
It's in very early ALPHA, but might work for you.
Removes the need for the REST API entirely. Uses native Google Protocol Buffers (same as the Python/Java/etc. runtimes)
Tom

Google APIs Client Library for PHP - countryBlocked exception

I've created a web application which runs with the 'Google APIs Client Library'.
This worked perfectly for me for the last two years.
But since yesterday I am facing a huge problem.
If I want to access the analytics api the system returns:
Google_Service_Exception Object
(
[errors:protected] => Array
(
[0] => Array
(
[domain] => global
[reason] => countryBlocked
[message] => This service is not available from your region
)
)
[retryMap:Google_Service_Exception:private] => Array
(
[500] => -1
[503] => -1
[rateLimitExceeded] => -1
[userRateLimitExceeded] => -1
)
[message:protected] => Error calling GET https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles: (403) This service is not available from your region
)
I've checked the logs and made 50 requests the last 30 days so spamming could not be the reason for the block.
When I run it from a different Server it runs just fine.
Can anyone explain why this is happening and how I can bypass it?

How to retrieve a specific discussion from linkedin group using PHP

How can I retrieve a specific post/discussion from a open group through LinkedIn API using PHP.
I was trying with the following API request as shown in here http://developer.linkedin.com/documents/groups-api#post :
https://api.linkedin.com/v1/posts/5835685921059532803:(id,type,category,creator,title,summary,creation-timestamp,relation-to-viewer:(is-following,is-liked,available-actions),likes,comments,attachment,site-group-post-url)
But this returns the following error:
Array
(
[status_code] => 400
[data] => stdClass Object
(
[errorCode] => 0
[message] => Invalid Post.id String {5835685921059532803}
[requestId] => XW2XMPBNKY
[status] => 400
[timestamp] => 1391441328953
)
)
Now, what's the error I have made with this request? What should I do to get a specific discussion?
Thanks.
I just solved the problem. The problem was while making the request. The discussion id (5835685921059532803) I was sending with URL was in wrong format. It should be like: g-GROUP_ID-S-DISCUSSION/POST_ID, for example: g-24405-S-5835685921059532803.
So the URL should be:
https://api.linkedin.com/v1/posts/g-24405-S-5835685921059532803:(id,type,category,creator,title,summary,creation-timestamp,relation-to-viewer:(is-following,is-liked,available-actions),likes,comments,attachment,site-group-post-url)
Hope this would save someone's valuable time.
You need An Api key and Secret key,to get an AUTHORIZATION_CODE,using that AUTHORIZATION_CODE,you will get an Access Token,and with that Access Token if you hit the url,then you will get the proper data,
details http://developer.linkedin.com/documents/authentication

Categories