I am trying to make an android app for a wordpress website. But unable to get the JSON of post. I tried with two pluginsThese are the plugins of the website
for JSON
WP Rest API
JSON API
WP Rest API is returning this
[]
and JSON API is returning this
{
"status": "ok",
"count": 0,
"pages": 0,
"category": {
"id": 21,
"slug": "maths",
"title": "Maths",
"description": "",
"parent": 13,
"post_count": 3
},
"posts": []
}
According to me this problem is due to any other plugin. But I am unable to find the solution
API using for JSON
1. with JSON API plugin I am using this link http://iitianlogic.com/custom/get_category_posts/
and posting id=4
The request url is not correct, Please try the below url which showing posts under uncategorized category http://iitianlogic.com/api/core/get_category_posts/?slug=uncategorized
Hope this will work
Related
I am trying to send a POST request to Jira API
Example Json
{
"fields": {
"project":
{
"key": "BAR"
},
"summary": "testttt",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Bug"
},
"priority" :{
"name" : "Low"
}
}
}
I am successfully making a POST request with postman to the API but I am struggling to make this POST request with Laravel.
I made a form in HTML where the admin must write some data like summary description issuetype and priority. I am accepting the data in the back end but I am having trouble how can I build such JSON with Laravel.
As you can see here
"issuetype": {
"name": "Bug"
}
name is nested in the issutype how can I explicitly create it to be ready to send into the API
I have two websites
UAE
KAS
If I place the order by using the guest cart, it's automatically assigned to store 1, which is a default for website 1: UAE.
There is no provision of creating quest cart specific to the website.
available website are:
[
{
"id": 1,
"code": "base",
"name": "Main Website",
"default_group_id": 1
},
{
"id": 0,
"code": "admin",
"name": "Admin",
"default_group_id": 0
},
{
"id": 2,
"code": "saudiwebsite",
"name": "Saudi Website",
"default_group_id": 2
}
]
We can place the order on respective site by using front-end URLs of the respective websites. The Magento API automatically places the order of the requested site.
I am trying to add event tracking to a product that is being translated to html cross-domain...
The file is located server-side and written in PHP. The JSON snippet that I need to append the GA event to is as follows:
"products": [
{
"title": "product",
"description": "description",
"thumbnail": "http://myurl.com/picture.jpg",
"price": "£1.99",
"url": "http://link.com"
},]
Now, reading up a little bit on this on this article has given me a bit of insight: Using google analytics to track hits on an XML web service
Would it be a matter of something as simple as this?
<?php
//Initilize GA Tracker
$tracker = new GoogleAnalytics\Tracker('UA-12345678-9', 'example.com');
?>
"products": [
{
"title": "product",
"description": "description",
"thumbnail": "http://myurl.com/picture.jpg",
"price": "£1.99",
"url": "http://link.com"
},$ga->setEvent("Category", "Action", "Label", "Value");]
Sure, look at mit Github Project
https://github.com/ins0/google-measurement-php-client
it is a PHP client library to communicate with Google Analytics from server-side.
otherwise you can use other great repositorys, look here
https://github.com/search?q=google-measurement&source=cc
We are building a activity stream kind of website very similar to facebook (in activity feed alone). For loading user's activity feed, we send the request to PHP file through AJAX method. Server file will handle the logic and return back the values as an array in JSON format. I wanted to know, is there any framework available to write the JSON response to HTML elements. Also, the fees are not similar. It will vary according to the type (Photo, Album, Status Updated, Shared, Liked, etc). So i need to load different template view for each of the activity feed. Actions will be common like Share, Comments for all feeds.
Can you please share which will be the best approach to load the content according to the data received. Also the content need to be refreshed periodically. I have pasted the sample JSON response below for reference:
{
"id": "1",
"picture": "",
"link": "http://www.google.com",
"name": "Srini updated status",
"description": "Lorem ipsum",
"actions": [
{
"name": "Share",
"link": "http://networkedblogs.com/hGWk3?a=share"
}
],
"type": "statusupdate",
"created_time": "2011-05-10T18:35:38+0000",
"updated_time": "2012-07-20T10:42:58+0000",
"likes": {
"count": 0
},
"comments": {
"data": [
{
"id": "19292868552_10150189643478553_22286888",
"from": {
"name": "Lorenzo Portillo",
"id": "613727863"
},
"message": "does anyone knows why i get a rhombus and '?' in my app description when I publish in a user's wall, instead of a letter with accent?!?!?!?!?!?",
"created_time": "2012-05-28T13:48:45+0000"
},
"count": 1
}
}
Need help / suggestions on how to design the template according to the json array in javascript. Any comments / code help will be more helpful.
Thanks in Advance,
Regards
Srinivasan.C
Well, if you consider making a very robust app, take a good look at emberjs.
You should also try jquery's (jquery mobile, jquery ui, jquery ajax)
You can create an html output in your php file when you are getting the response from the Facebook API. According to me you can do json operation easily in PHP. By using json_decode you get array and that you can traverse it and build an html as per your requirement.
Hope it helps
I'm currently writing a PHP application.
I noticed something strange when it wasn't returning the persons birthday.
To cut a long story short, when i manually query the graph api, it gives me the full result set (birthday, email etc. included). However, when I run it in my app, it comes back as if i've not sent the access token.
When I manually visit the address it produces:
{
"id": "507665705",
"name": "Ally Dewar",
"first_name": "Ally",
"last_name": "Dewar",
"link": "https://www.facebook.com/alastair.dewar",
"username": "alastair.dewar",
"birthday": "06/22/1990",
"location": {
"id": "113744028635772",
"name": "Greenock"
},
"gender": "male",
"email": "alastair\u0040alastairdewar.co.uk",
"timezone": 1,
"locale": "en_GB",
"verified": true,
"updated_time": "2012-03-11T15:56:19+0000"
}
However, when my application makes the same request (exact same URL), it comes back with
{"id":"507665705","name":"Ally Dewar","first_name":"Ally","last_name":"Dewar","link":"http:\/\/www.facebook.com\/alastair.dewar","username":"alastair.dewar","gender":"male","email":"alastair\u0040alastairdewar.co.uk","locale":"en_GB"}
My instinct says it could be a setting within the facebook app, as it wasn't a problem beforehand.
EDIT: https://developers.facebook.com/bugs/412680422092698?browse=search_4f854dc037a2a5d12811839
Thanks for any advice.
Make sure you ask for all the permissions that you need and also remove the app and start again. Make sure you ddon't cache any of the responses as well.
How do you query the API? Graph Explorer or just manually open the link (graph.facebook.com/USER_ID) and pass the auth token generated by the app? Testing with the Graph Explorer won't help you with your problem as permissions etc are different.
As mentioned by Nobita, code helps. This is as much as I can advise considering the amount of data you're giving us.