Add Followers in Task - asana

Can I add an array of followers in the creation of the task? There addTag & addProject. The task is written followers read-only.
Thank you, Ruslan

The documentation does say that followers is read-only, but it's not when you are creating a task. So some JSON like this when you are creating a task will let you set the followers:
{ "data" : { "name": "task name", "workspace": 12345, "assignee" : 56123, "followers": [6677, 1234] } }
But you can't (yet) change the followers via the API once it's created.

Related

Create Microsoft Teams Meeting invite programatically using graph api

I am trying to create Teams Meeting invite via graph API but unable to figure out how to send meeting participants via the body as their documentation is not clear. I was using the graph API /me/onlineMeetings as mentioned here with the following body. I am not sure if this is the correct way, All I know is meeting timings, participant email ids. Can someone help me here?
Post request body:
{
"startDateTime":"2021-05-13T10:30:34.2444915-07:00",
"endDateTime":"2021-05-13T10:35:34.2464912-07:00",
"subject":"Testing Invite",
"meetingParticipants": {
"attendees": [{
"mail": "test#outlook.com"
}]
}
}
Yes, you can using graph API.
You need to update your meeting. Please refer to this Update onlineMeeting
You need to update participants property to add/remove attendees.
NOTE You can only modify the attendees field. You cannot update organizer field of the participants property.
To specify presenters and/or attendants please use the below structure.
To find additional information , please refer to the onlineMeeting Properties, and click though to the sub-objects such as attendees.
AFAIK you can not use the API to add presenters / attendees later.
{
"startDateTime": "{{startDateTime}}",
"endDateTime": "{{endDateTime}}",
"subject": "Meeting with {{Attendee_upn}} regarding {{$randomBs}}",
"autoAdmittedUsers": "EveryoneInCompany",
"participants": {
"organizer": {
"identity": {
"user": {
"upn": "jos#jvteams.xyz"
}
}
},
"attendees": [
{
"upn": "{{Attendee_upn}}",
"identity": {
"user": {
"id": "{{Attendee_id}}"
}
}
}
]
}
}

Twilio Taskrouter - How to add information to custom tasks?

I'm working with Twilio programmable video and I'd like to integrate it with TaskRouter.
Currently I can create custom tasks with a POST request to:
https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSID}/Tasks/
Yet regardless of what I put into the request body, the task shows up as "Anonymous Task, Reserved".
Is this an issue of formatting? I'd ideally like it to say something along the lines of "Incoming video request" with the customer name in the task-bar similar to how chat tasks look.
Here's the dummy data I tried passing in to no avail. I've tried a few different ways:
{
"attributes": {
"type": "video",
"contact": "+17777777777",
"customer-value": "gold",
"task-reason": "support",
"callSid": "CA42ed11...",
"name": "Joe",
"customer_name": "Joe"
}
"name": "Joe",
"customer_name": "Joe"
}
None of this data is passed through to the task. Any help would be appreciated.

Query in firebase Database in iOS

I work with firebase database, I have the following data,
I need to get all groups names (GName) of a user by his phoneNum, i.e. all groups of specific user, How can I get that in swift 4?
You should consider restructuring your data. If a user belongs to more than one group in your application then you'll probably have to duplicate your user node for every group the user belongs to in your data structure. You can create another JSON object that holds all of the groups that a user belongs to. Here is a sample JSON for you:
{
"users": [{
"xyz123": {
"userId": "xyz123",
"username": "user1",
"phoneNum": "123456",
"groups": [{
"groupId": 1,
"groupName": "aaa"
}, {
"groupId": 2,
"groupName": "bbb"
}]
}
}]
}
As for filtering with the phone number, you can get all users inside a list and filter the result with the phone number criteria
result = result.filter({item.phoneNum == "123456"})
or get phone number of the user to a upper level, call .child() method with the phone number criteria and fetch the specific user.
Also take a look at structuring data part at firebase documentation.
https://firebase.google.com/docs/database/ios/structure-data
Hope that helps.

Microsoft graph batch requests

I have the following requirement :
create an office 365 unified group
add members to it
add each of the members to the accepted senders list of the group
fetch the following IDS for local storage (sql server)
The group ID
The group's main thread ID
The group's main planner plan ID
The group's main planner bucket ID
Can I batch this using the following : https://developer.microsoft.com/en-us/graph/docs/concepts/json_batching
The way I am doing it, I have a request object (in the JSON batch) for each api request.
Logically, I can't proceed with any of my requests without having created the group. So the first one will be the POST to the groups endpoint.
What I would like is a way for subsequent requests to use the newly created group ID to, for example, add members.
Is that doable in the same batch (same JSON batch object)?
If yes, how?
You can use dependsOn to sequence requests as specific order but it will be easier to run them as separated batches, one after another.
Create group
Add members
...
For adding users in a batch try json like this (replace id's with group and userIds):
`
{
"requests": [
{
"id": "1",
"method": "POST",
"url": "/v1.0/groups/{id}/members/$ref"
"body": {
"#odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{id}"
}
}
{
"id": "2",
"method": "POST",
"url": "/v1.0/groups/{id}/members/$ref"
"body": {
"#odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{id}"
}
}
]
}
`

Get event rsvp summary using koala gem in rails

I have been able to retrieve event details using
#graph = Koala::Facebook::API.new(access_token)
#eventSummary = #graph.get_object(eventId)
and getting users list invited using
#eventSummary = #graph.get_connections(eventId, "invited")
I want to get count for all user invited, maybe, Declined and accepted for the event. for which i'm using
#eventSummary = #graph.get_connections(eventId, "invited?summary=1")
which again giving me the list of users only. when used graph.facebook like
https://graph.facebook.com/***eventId***/invited?access_token=*****access_token****&summary=1
i'm getting the count in result.
{
"data": [
{
"name": "xyz",
"rsvp_status": "attending",
"id": "10000000123"
}
],
"paging": {
"next": "https://graph.facebook.com/***eventId***/invited?summary=1&access_token=***accesstoken***&limit=5000&offset=5000&__after_id=100004389574321"
},
"summary": {
"noreply_count": 0,
"maybe_count": 0,
"declined_count": 0,
"attending_count": 1,
"count": 1
}
}
for just solving purpose i'm getting result using fql, as:
#eventSummary = #graph.get_object("fql", :q => "SELECT all_members_count, attending_count, declined_count, not_replied_count, unsure_count FROM event WHERE eid = #{eventId}")
But this is not convenient to use.
Can anyone please help, what am i doing wrong ? To get Event RSVP counts.
I'm using rails v.3.2, for facebook using Koala gem.
Thanks in advance.
I've seen it too, that when you request the event itself, those attendee count fields aren't included. You can use the second parameter to specifically ask for them though:
#eventSummary = #graph.get_object(eventId)
#eventSummary.merge(#graph.get_object(eventId, fields: "attending_count,declined_count,interested_count"))
The first call gets your "standard" event details, something like this:
{"description"=>"Blah blah blah",
"name"=>"My Event Will Rock",
"place"=>{"name"=>"Venue Bar",
"location"=>{"city"=>"Citytown",
"country"=>"United States",
"latitude"=>43.05308,
"longitude"=>-87.89614,
"state"=>"WI",
"street"=>"1216 E Brady St",
"zip"=>"53202"},
"id"=>"260257960731155"},
"start_time"=>"2016-04-22T21:00:00-0500",
"id"=>"1018506428220311"}
The second call gets just those "additional" requested fields:
{"attending_count"=>3,
"declined_count"=>0,
"interested_count"=>12,
"id"=>"1018506428220311"}
You can store them in separate variables, or as I'm suggesting above, use the hash#merge method. (There shouldn't be any problematic overlap between the keys of these two hashes.)
Alternatively, you can get all these details in one request by explicitly requesting everything you want.

Resources