LinkedIn API: Share without submitted URL - linkedin

Is possible share a state without submitted-URL parameter through LinkedIn API?
Is there an example? Thanks!

There is no way to do it, this field is requiring if you try this request in APIGee.com Console.

Yes! is possible. Whith de Endpoint: people/~/shares/ and JSON like this...
{
"comment": "comment to post",
"visibility":{
"code":"anyone"
}
}

Related

Some fields of userinfo return empty Wechat API

I use WeChat API to get user info, but some fields are empty ("nickname" is empty). This API has worked before 12/05/2022 but it's failed now. I don't know why we cannot get these values. Please help me take a look at this. Thank you so much.
https://developers.weixin.qq.com/doc/offiaccount/en/User_Management/Get_users_basic_information_UnionID.html#UinonId
Link image
According to the WeChat official description, this method will no longer output avatar and nickname information after 12/27/2021.
Using button component with "open-type"="getUserInfo".And then you will get userInfo in "bindgetuserinfo" function.
<button bindgetuserinfo="handleGetUserInfo" open-type="getUserInfo">getUserInfo</button>
new Page({
handleGetUserInfo(e){
console.log(e)
//...some code
}
})

Always get “Cannot parse non Measurement Protocol hits”

I have a little Python program that other people use and I would like to offer opt-in telemetry such that can get an idea of the usage patterns. Google Analytics 4 with the Measurement Protocol seems to be the thing that I want to use. I have created a new property and a new data stream.
I have tried to validate the request and set it to www.google-analytics.com/debug/mp/collect?measurement_id=G-LQDLGRLGZS&api_secret=JXGZ_CyvTt29ucNi9y0DkA via post and send this JSON payload:
{
"app_instance_id": "MyAppId",
"client_id": "TestClient.xx",
"events": [
{
"name": "login",
"params": {}
}
]
}
The response that I get is this:
{
"validationMessages": [
{
"description": "Cannot parse non Measurement Protocol hits.",
"validationCode": "INTERNAL_ERROR"
}
]
}
I seem to be doing exactly what they do in the documentation or tutorials. I must be doing something wrong, but I don't know, what is missing. What do I have to do in order to successfully validate the request?
Try to remove /debug part in the URL. In the example you followed it is not present so it is not quite exactly the same.
we just came across the same issue and the solution for us was to put https:// in front of the URL. Hope this helps.

Firebase FCM fcm_options.link doesn't work

I'm using multicast to send the message to multiple users like this:
let webAppMessage = {
priority:'high',
notification:{title: titleNotif , body: `${name}: ${message}`, image: 'https://i.imgur.com/L6plOZO.png'},
tokens: webTokens,
webpush: {
fcm_options: {
link: "https://dummy.com"
}
}
admin.messaging().sendMulticast(webAppMessage)
However, clicking on the notification doesn't direct to the link.
I'm using firebase 8.6.3. I checked the other posts, but they don't resolve my issue. Is this because I'm using multicast to send the message? I can't find anything on the documentation about that.
This post solved it for me:
Firebase push notifications click does not work
Just use relative links... unlike what their documentation claims

Override the method of packing HTTP form-urlencoded parameters in Meteor HTTP call

I'm using Meteor to consume a remote API. One of the endpoints of this API requires an (ordered) array of credentials, so the data would look like
{
"country": "de",
"credentials": ["admin", "password"],
"whatever": "whatever"
}
When I provide this plain-object as the value to param property of HTTP.post like this
HTTP.post('https://api.whatever.org/whatever', {
headers: {
"Authorization": "Basic ".concat(...)
},
params: {
"country": "de",
"credentials": ["admin", "password"],
"whatever": "whatever"
}
});
then the parameters are packed this way:
country=de
credentials=admin,password
whatever=whatever
but they should be packed this way:
country=de
credentials=admin
credentials=password
whatever=whatever
I tried using a Content-Type header but it didn't help.
I tried using content and data instead of params with different outcomes and then ended concatenating all the values into a query string an putting it into content property. But this isn't really a nice piece of code and surely not one that is easy to maintain.
I've read docs but haven't found anything that would help.
Where should I look for the information regarding this topic? Is there a better way to override the way HTTP.post (or, in general, HTTP.call) computes the body of the query to send?
Where should I look for the information regarding this topic?
In the source code.
I know nothing about Meteor, but I’m looking into its source code and I see no public hook which could help you. Of course, you can replace URL._encodeParams with your own function, but that is less maintainable than submitting the encoded params as raw data.

Find out my own user ID for sending a message with Telegram API

For Telegram, how can I find out my own user id (chat_id) for use with the Telegram API?
I want to send myself a message via the Telegram API, like this:
https://api.telegram.org/bot<BOTID>/sendMessage
Send a message to your bot then retrieve the update with:
https://api.telegram.org/bot<BOTID>/getUpdates
In the json string returned you will find you chat_id/user_id.
In single chat with the bot chat_id is equal to user_id.
Now you can send your message with:
https://api.telegram.org/bot<BOTID>/sendMessage?chat_id="yourchatid"&text="Hello!"
You could use Json Dump Bot.
The relevant section of the output will be similar to:
{
"message": {
"from": {
"id": WHAT_YOU_ARE_LOOKING_FOR,
"is_bot": false,
"first_name": "Paolo",
"language_code": "it"
}
}
}
or: https://t.me/userinfobot - just forward message to get his id
The easier way is to go to the web version of Telegram and go to the chat whose ID you want to know. It'll be in the URL which is in form:
https://web.telegram.org/#/im?p=u<ID>_<something>
For groups this works too, but their IDs are negative, so if URL looks like
https://web.telegram.org/#/im?p=g1234567
then group chat ID is -1234567.
On Android (or rather Lineage) I was able to look up the user_id under "Settings > Accounts > Telegram"
The placeholder is actually a token, not a key. Surely you already know what that is and can use it?
https://core.telegram.org/bots/api#authorizing-your-bot

Resources