Thanks for your reply, – I can only work on this in my free time (weekend) and will take a look at your links.Ĭan you please ty to check if you are able to access any other private pages on your wordpress site with the application password. This topic was modified 5 months, 1 week ago by _Jo. (Question was als asked at the Matomo forum) Is there a way to get that data? If so, can you give me a hint as to how? I’m not sure what to do now, as I thought authenticating myself with the WordPress application password would be enough to get access. (This should have the rows of data for the pages by pageviews.) I created an application password and used that in the Curl call, which was successful, but in the returned object is empty, as I believe it is marked as private. But when I call that script via Curl, I, understandably, get the Matomo error that I need to be logged in. I successfully generated that data, and it works when I do it manually, as I am recognized as logged in. It’s a list of the top posts of today to display on the website, automated via PHP and Curl, regenerated three times an hour. I’m coming from GA but want to recreate my PHP script with Matomo. Duplicate headers are available as an indexed array under the shared key.Hi! I’m currently at a loss for ideas and hoping for a nudge in the right direction. Indexes are transformed to snake_case for access. Headers (object) - An object with all of the response headers populated. See "Direct Iteration and Response Decoding" for ways to parse and access this data. Response (string)- The raw response body content. Response DetailsĪfter making a request with one of the HTTP verb methods, or execute, the returned instance will have the following data populated: Method (string) - HTTP verb to perform the request with. All arguments expect the same values as in the convenience methods, with the exception of the additional method argument: You can make a request using any verb by calling execute() directly, which accepts four arguments: url, method, parameters and headers. A nested, indexed array is passed for parameters with multiple values and will be iterated to populate duplicate keys See: "Duplicate Headers and Parameters" Other Verbs Headers (array) - An associative array of headers to include with the request. A nested, indexed array is passed for parameters with multiple values and will be iterated to populate duplicate keys See: "Duplicate Headers and Parameters" If an array is passed it will be encoded into a query string. Parameters (string), (array) - String or associative array to be appended to the URL in GET requests and passed in the request body on all others. Will be appended with the value of the format option, if it has been configured. Will be prepended with the value of the base_url option, if it has been configured. Url (string) - URL of the resource you are requesting. $api-> set_option( 'user_agent', " my-application/0.1") Standard Verbsįour HTTP verbs are implemented as convenience methods: get(), post(), put() and delete(). Options can be set upon instantiation, or individually afterword: Password - Password to use for HTTP basic authentication. Username - Username to use for HTTP basic authentication. See "Direct Iteration and Response Decoding". User_agent - User agent string to use in requests.īase_url - URL to use for the base of each request.įormat - Format string is appended to resource on request (extension), and used to determine which decoder to use on response a request URL like "/1.1/statuses/user_timeline.json" would be expected to return well-formed JSON.įormat_regex - Pattern to extract format from response Content-Type header, used to determine which decoder to use on response.ĭecoders - Associative array of format decoders. Use this option to enable the default behavior. These will override any automatically generated values.īuild_indexed_queries (bool) - http_build_query automatically adds an array index to repeated parameters which is not desirable on most systems. Parameters - An associative array of URL or body parameters to be included in every request.Ĭurl_options - cURL options to apply to every request anything defined here. Headers - An associative array of HTTP headers and values to be included in every request. Var_dump( $result-> decode_response()) Configurable Options GET if( $result-> info-> http_code = 200) $result = $api-> get(" search/tweets", )
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |