I work with "Search Console API v3" now.
When I use "webmasters.sites.list" method, I get site URLs and propery sets. Propery set for expample - "sc-set:B9KPftMA4RltK1LS61GR2g".
But I can't find any way to get REAL NAME for property set using API.
I can't show this id "sc-set:B9KPftMA4RltK1LS61GR2g" to client instead normal name.
Example of response:
"siteEntry": [ { "siteUrl": "example.com", "permissionLevel": "siteRestrictedUser" },
{ "siteUrl": "sc-set:2d0rU0BQiIHsmCH-HGZ1KA", "permissionLevel": "siteRestrictedUser" }
]
when you call sites.list it returns a list of site resources which contain
{
"siteUrl": "http://www.daimto.com/",
"permissionLevel": "siteOwner"
},
There is no way to get any additional information about the site than that. What i am not able to understand is why you appear to be getting back some kind of id.
Related
When adding New Relic APM to track Parse Server, the calls to Cloud Code functions and Classes are displayed as:
/parse/classes/:className
/parse/functions/:functionName
Instead I want to display them as:
/parse/classes/myClass
/parse/functions/myFunction
For Cloud Code function calls I can set the transaction name:
Parse.Cloud.define("myFunction", async(request) => {
newrelic.setTransactionName("myFunction");
//...
});
But how can I track the names of all the calls to classes?
The New Relic Node.js agent has an auto-naming feature for transactions that can't be turned off*.
From the docs:
The only important thing to know about New Relic's support for Express, Restify, or Hapi is that if you're dissatisfied with the names it comes up with, you can use the API calls described below to come up with more descriptive names.
So the solution was to override these default name rules by adding custom name rules to newrelic.js. The trick is to use the regex group substitute as the name.
rules: {
name: [
// post /parse/classes/:classeName
// get /parse/classes/:classeName/:objectId
{
pattern: '^(\/parse\/classes\/[_0-9A-Za-z]*)(\/.*)*',
name: '\\1'
},
// post /parse/functions/:functionName
{
pattern: '^(\/parse\/functions\/.*)$',
name: '\\1'
},
// post /parse/files/:filename
// get /parse/files/:appId/:filename
{
pattern: '^(\/parse\/files)\/.*$',
name: '\\1'
}
]
}
The pattern above groups the calls by class name, ignoring the object ID that is sometimes appended. That makes it also unnecessary to add a setTransactionName for every Cloud Code function.
*It can be turned off for the Java agent, but that option does not seem to exists for the Node.js agent.
I am building an API and I have few models which have a relationship with each other:
Asset
Location
User
I am able to get objects via api by accessing /asset/5 or /location/15
This is all fine and good, now I have started to include some relations with it.. so if asset 5 is related to location 15.. the return from /asset/5 now includes (using WITH) the location info with it.
example:
/asset/5
{
"id": 5,
--> "uri": http: //localhost/api/asset/5, <-- how do i generate/append this
"name": null,
"location": {
"id": 15,
"name": "jimUser",
--> "uri": "http://localhost/api/location/5" <-- how do i generate/append this
}
}
(the URI is not part of my schema.. I want to have it added to the response.)
all of the location info is now returned with the asset. exactly what am looking for..
What I am trying to do is find a way to populate those URI fields with a link that is direct to that entity. so on the /asset/ return that contains the related location info I want to be able to provide a link that goes directly to that location.
I am unable to find a way to generate the URI for either the main response (in this case it is asset) or for a relation (in this case it is location)
I am new to Laravel and am trying to basically mirror an application that has this same type of reponse.
Any help is appreciated.
Thanks
I tried working with $request, $router and many others.
Create an accessor for your uri attribute and set it to be appended automatically to the JSON response:
// Location.php
class Location
{
protected $appends = ['uri'];
...
public function getUriAttribute()
{
return '/api/locations/' . $this->id;
}
}
I have looked all over the net, trolled through spring-data-rest source code and tried to decipher how the JS for the hal-browser is trying to retrieve 'title' and 'doc' details for a resource. I have also discovered that there are
#RepositoryRestResource(
collectionResourceRel = "roles",
path = "roles",
itemResourceDescription = #Description("This is a test description")
)
Annotations I can put in the #Repostitory, but it doesn't seem to do anything.
Specifically, if you look at this example, how do I get "title|doc" to fill in"
I filed a ticket with spring and haven't heard back.
From what I can see the HAL Browser expects the link to contain the title property. In the example you linked:
{
"motd": "Welcome to the OSDI Example Action Platform OSDI API endpoint!!",
"_links": {
"osdi:people": {
"href": "http://api.opensupporter.org/api/v1/people",
"title": "The collection of people in the system"
}
...
}
The org.springframework.hateoas.Link class does not support that property as of version 0.19.0.RELEASE. No idea about the docs though...
I am using Comments: list method
Request
https://www.googleapis.com/youtube/v3/comments?part=snippet&parentId=ay4MKe1u7Ec&key=`{MY_KEY}`
I use API get comments return this
{
"kind": "youtube#commentListResponse",
"etag": "\"xmg9xJZuZD438sF4hb-VcBBREXc/pGLBhpjR05yQoJV31WoAx2PEFVw\"",
"items": []
}
The comments->list method is only used when you need to get additional info about comments where you already know the comment ID ... or in the case of your URL, if you are trying to get more details about comments that are replies to a parentID. In other words, you can't put a videoID into the comments->list method.
What you want is the commentThreads->list endpoint:
https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId=ay4MKe1u7Ec&key={YOUR_API_KEY}
That'll give you all the comments with their IDs ... you can take those IDs, then, and run them through the comments->list endpoint to get more granular info.
I have been trying to get list of event invitations sent to user. I played around with Graph API explorer found from
https://developers.facebook.com/tools/explorer
I have tried calling https://graph.facebook.com/userid/events but it returns me only events user has responded to as 'attending' or 'unsure'.
Is it possible to get list of event invitations for user like displayed in Facebook event page.
Also I don't know how to list events user has responded as 'declined'.
Maybe I am missing proper permission but I doubt it since I gave all event related permissions to grap explorer and still got only 'attending' or 'unsure' RSVPt events.
You can also do a GET on /{userid}/events/not_replied. It seems that Users that have not Joined the event will not show up in the /{userid}/events lists and if you look at the docs there is a subtle note there about only listing events that the user has joined. The old rest API seems to keep them in one list.
You will need to HTTP Get the following from the Graph API:
fql?q=SELECT uid,eid,rsvp_status FROM event_member WHERE uid = me()
You can get back all three statuses from that call.
{
"data": [
{
"uid": "723020003",
"eid": "19935786340002",
"rsvp_status": "not_replied"
},
{
"uid": "723020003",
"eid": "234524000290351",
"rsvp_status": "attending"
},
{
"uid": "723020003",
"eid": "210091000081240",
"rsvp_status": "declined"
}
]
}