How to get filtered activity stream using Yammer API? - yammer

Yammer Activity Stream is available at:
https://www.yammer.com/api/v1/streams/activities.json?access_token=
This successfully results in all the recent activities like:
{
"items": [
{
"id": "/users/www.yammer.com-341514-1508953644/rollups/45191477209921-45191477209921",
"unseen": true,
"icon": "/images/notifications/page_add.png",
"icon_name": null,
"category": "file-create",
"message": "[[user:1508783078]] uploaded [[uploaded_file:24511980]].",
"heading": "",
"created_at": "2014/10/02 07:07:42 +0000",
"objects": [],
"actions": [],
"subject": {
"type": "uploaded_file",
"id": 24511980
},
"meta": null,
"client_type": "unknown",
"client_url": "https://www.yammer.com",
"client_icon": "https://mug0.assets-yammer.com/mugshot/images/16x16/3rd_party.png",
"client_large_icon": "https://mug0.assets-yammer.com/mugshot/images/75x75/3rd_party.png",
"image": "https://mug0.assets-yammer.com/mugshot/images/48x48/no_photo.png",
"third_party": false
},
{
"id": "/users/www.yammer.com-341514-1508953644/rollups/45191475863746-45191475863746",
"unseen": true,
"icon": "/images/notifications/page_add.png",
"icon_name": "page",
"category": "file-download",
"message": "[[user:1508783078]] downloaded [[uploaded_file:24373320]] from the [[group:3455089]] group.",
"heading": "",
"created_at": "2014/10/02 07:07:00 +0000",
"objects": [
{
"id": 24373320,
"type": "uploaded_file"
}
],
"actions": [],
"subject": {
"type": "uploaded_file",
"id": 24373320
},
"meta": null,
"client_type": "unknown",
"client_url": "https://www.yammer.com",
"client_icon": "https://mug0.assets-yammer.com/mugshot/images/16x16/3rd_party.png",
"client_large_icon": "https://mug0.assets-yammer.com/mugshot/images/75x75/3rd_party.png",
"image": "https://mug0.assets-yammer.com/mugshot/images/48x48/no_photo.png",
"third_party": false
},
]}
QUESTION:
I am trying to get all the recent activities after a certain time-stamp or after a certain offset. Is there any query parameter for that?

this is
older_than="/users/www.yammer.com-341514-1508953644/rollups/45191475863746-45191475863746"
that would return all the activities older than the last activities you shew in your sample return value

Related

API Platform 3 does not return null data in response body

In API Platform 2.7 the response body contained fields that had a null value, after upgrading to API Platform 3 the response body does not contain fields that have a null value. Is this deliberate or due to a configuration change I need to make.
I executed the same call from the api/docs page for 2.7 and 3.0 I expected the results to be the same.
API Platform 2.7 response for class Patient
{
"#context": "/api/contexts/Patient",
"#id": "/api/patients/8110",
"#type": "Patient",
"account": "/api/accounts/8110",
"accountId": 8110,
"isDependent": false,
"isGuardian": false,
"organization": "/api/organizations/765",
"email": null,
"title": null,
"firstName": "CA",
"middleInitial": "A",
"lastName": "Patient",
"suffix": null,
"photoMedia": null,
"sex": "male",
"birthDate": "2000-01-01T00:00:00+00:00",
"addressLineOne": "5759 Witting Corners",
"addressLineTwo": null,
"city": "Marvintown",
"zipCode": "35507",
"state": {
"#id": "/api/states/681",
"#type": "State",
"abbreviation": "CA"
},
"phoneNumber": "617-491-0000",
"mobileNumber": null,
"workNumber": null
}
API Platform 3.0 response for class Patient
{
"#context": "/api/contexts/Patient",
"#id": "/api/patients/8110",
"#type": "Patient",
"account": "/api/accounts/8110",
"accountId": 8110,
"isDependent": false,
"isGuardian": false,
"organization": "/api/organizations/765",
"firstName": "CA",
"middleInitial": "A",
"lastName": "Patient",
"sex": "male",
"birthDate": "2000-01-01T00:00:00+00:00",
"addressLineOne": "5759 Witting Corners",
"city": "Marvintown",
"zipCode": "35507",
"state": {
"#id": "/api/states/681",
"#type": "State",
"abbreviation": "CA"
},
"phoneNumber": "617-491-0000",
}
Relates to this question
You only need to set skip_null_values to false in your normalization_context, because starting 3.0.0 beta 1 they decided it would become true by default.
If you need it to be false for all resources, you can set the default in your config/packages/api_platform.yaml:
api_platform:
...
defaults:
normalization_context:
skip_null_values: false

Combine json response in nifi

We are calling invokehttp processes and getting response which json. Example
{
"id": "h569gcjhcm",
"doi": {
"id": "10.17632/h569gcjhcm.1",
"status": "allocated",
"prefix": "10.17632"
},
"name": "Data for: Flooding of the Caspian Sea at the intensification of Northern Hemisphere Glaciations",
"description": "Supplementary data for the Jeirankechmez section in Azerbaijan.\n\n- Appendix A contains all paleomagnetic data and interpretations of the Jeirankechmez section. This .dir file can be imported into the paleomagnetism.org webportal under \"Interpretation Portal\", \"Advanced Options\", \"Import Application Save\". For further details on the use of paleomagnetism.org please refer to the article by Koymans et al. (2016) - https://doi.org/10.1016/j.cageo.2016.05.007.\n- Appendix B contains the magnetic susceptibility data for the analysed samples, including geographic coordinates and stratigraphic levels.\n- Appendix C contains the 40Ar/39Ar data for the three analysed volcanic ash layers. ",
"version": 1,
"publish_date": "2019-01-29T12:51:38.090Z",
"data_licence": {
"id": "01d9c749-3c4d-4431-9df3-620b2dcfe144",
"short_name": "CC BY 4.0",
"full_name": "Creative Commons Attribution 4.0 International",
"description": "This dataset is licensed under a Creative Commons Attribution 4.0 International licence.\n\nWhat does this mean?\nYou can share, copy and modify this dataset so long as you give appropriate credit, provide a link to the CC BY license, and indicate if changes were made, but you may not do so in a way that suggests the rights holder has endorsed you or your use of the dataset. Note that further permission may be required for any content within the dataset that is identified as belonging to a third party.",
"url": "http://creativecommons.org/licenses/by/4.0",
"category": "Creative"
},
"contributors": [
{
"first_name": "Christiaan",
"last_name": "van Baak"
},
{
"first_name": "Marius",
"last_name": "Stoica"
},
{
"first_name": "Arjen",
"last_name": "Grothe"
},
{
"first_name": "Gareth",
"last_name": "Davies"
},
{
"profile_id": "72970719-95c8-341b-80d2-afa9e7154baf",
"first_name": "Wout",
"last_name": "Krijgsman"
},
{
"profile_id": "3a4bfe2c-4098-3859-9b88-789fa993e05a",
"first_name": "Keith",
"last_name": "Richards"
},
{
"profile_id": "f1660f3c-ebbd-3289-8240-1f4ea7913df4",
"first_name": "Klaudia",
"last_name": "Kuiper"
},
{
"first_name": "Elmira",
"last_name": "Aliyeva"
}
],
"versions": [
{
"version": 1,
"publish_date": "2019-01-29T12:51:38.090Z",
"available": true
}
],
"files": [
{
"filename": "Appendix_A_Jeirankechmez_pmag_interpretations.dir",
"id": "f2f4cba7-2411-4737-a9b2-f094db30dca1",
"content_details": {
"id": "994bc865-5300-4d76-a373-e528ccd830e8",
"sha256_hash": "2427c4b077372760973ce8224694f2a2ee5383c7f022ad818164d847a20e27cc",
"sha1_hash": "73792dc6d6eb2c1de1e04926ba5d4420dd0aaece",
"content_type": "application/x-director",
"size": 917022,
"created_date": "2019-01-03T00:00:00.000Z"
"download_expiry_time": "2019-01-29T13:52:25.729Z"
},
"metrics": {
"downloads": 0,
"previews": 0
}
},
{
"filename": "Appendix_B_Sample_locations_susceptibility.xlsx",
"id": "64241bf0-5279-49e8-a505-be9075b910e1",
"content_details": {
"id": "af8809d0-8e63-4599-abaa-e7af9ad39959",
"sha256_hash": "0588f44a0cbd477aa2798323e57ce0b2d4a118e767c0b1ffdc9eb1017e4d23c2",
"sha1_hash": "02e89f6f197ebf495e1e2c3d1aab250efc7545e7",
"content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"size": 24770,
"created_date": "2019-01-03T00:00:00.000Z"
,
"download_expiry_time": "2019-01-29T13:52:25.732Z"
},
"metrics": {
"downloads": 0,
"previews": 0
}
},
{
"filename": "Appendix_C_ArAr_data.xlsx",
"id": "2e912027-ff3f-48ad-98b9-b643b59ba0e3",
"content_details": {
"id": "4960377c-060d-41f6-b7af-150617d8ebeb",
"sha256_hash": "235dc32c1e99f350ee5c99908a5f5d72d1aeeab02f78c2e0181d585bd1880fa6",
"sha1_hash": "6483156e4577948cac5d2679eee862c76faed1c9",
"content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"size": 18510,
"created_date": "2019-01-03T00:00:00.000Z"
},
"metrics": {
"downloads": 0,
"previews": 0
}
}
],
"articles": [
{
"id": "10.1016/j.gloplacha.2019.01.007",
"title": "Flooding of the Caspian Sea at the intensification of Northern Hemisphere Glaciations",
"doi": "10.1016/j.gloplacha.2019.01.007",
"journal": {
"issn": "0921-8181",
"name": "Global and Planetary Change",
"url": "http://www.sciencedirect.com/science/journal/09218181"
}
}
],
"categories": [
{
"id": "http://com/vocabulary/OmniScience/Concept-170590667",
"label": "Geology"
},
{
"id": "http://data.elsevier.com/vocabulary/OmniScience/Concept-473860195",
"label": "Strontium Isotope"
}
],
"institutions": [ ],
"metrics": {
},
"available": true,
"related_links": [ ]
}
I am using $contributors.profile_id from above json to call new endpoint(invokeshttp) (https://api.xxx.com/profile/$.profile_id)
Json response for this
"contributors": [
{
“profile_id”:”cedferfiherhforhforf”
"first_name": “xxx”,
"last_name": "van Baak”,
“other_ids”:[] ,
“Other info”: “deeded” }
I have to call this endpoint depending upon number of object in contributor(let say we have 5 object in contributor ,so I have to call this endpoint 5 time)and combine these 5 response together
Then I have to merge the response(above response to the main response )
just an example:
EvaluateJsonPath to extract "id" into attribute, later join by this attribute
SplitJson to split your json by "contributors"
call endpoint
MergeContent merge by "id" and with count after SplitJson

'onlineMeetingUrl' is null after call Create Event in Graph api

I use create event api to create an event object with "onlineMeetingUrl: https://meet.lync.com/example/joyce/NLSD7Y62" but the response of "onlineMeetingUrl" is null.
Is it a bug or is there any way to create a new event with 'onlineMeetingUrl'?
Here are my test steps.
Step 1. POST /me/events
{
"#odata.etag": "W/\"BfXylo4WykyAenTZICXL5AAApUQ11g==\"",
"id": "AAMkADVmMzE2MjY0LTZkOGYtNGI4MS1iNWMxLTljYzg3MWY5MWQxMQBGAAAAAABZMfR36TVMQ6yunaqZPvVRBwAF9fKWjhbKTIB6dNkgJcvkAAAAAAENAAAF9fKWjhbKTIB6dNkgJcvkAAClFy2jAAA=",
"createdDateTime": "2018-03-07T02:31:20.6459109Z",
"lastModifiedDateTime": "2018-03-07T02:31:24.2554747Z",
"changeKey": "BfXylo4WykyAenTZICXL5AAApUQ11g==",
"categories": [],
"originalStartTimeZone": "Taipei Standard Time",
"originalEndTimeZone": "Taipei Standard Time",
"iCalUId": "040000008200E00074C5B7101A82E00800000000E5DACD60BCB5D301000000000000000010000000A65419D96CF4C347B8B3B5A340753291",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Sky Meeting",
"bodyPreview": "Join online meeting",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkADVmMzE2MjY0LTZkOGYtNGI4MS1iNWMxLTljYzg3MWY5MWQxMQBGAAAAAABZMfR36TVMQ6yunaqZPvVRBwAF9fKWjhbKTIB6dNkgJcvkAAAAAAENAAAF9fKWjhbKTIB6dNkgJcvkAAClFy2jAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl": "https://meet.lync.com/example/joyce/NLSD7Y62",
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "Join online meeting"
},
"start": {
"dateTime": "2018-03-08T00:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-03-08T00:30:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "Online meeting"
},
"recurrence": null,
"attendees": [],
"organizer": {
"emailAddress": {
"name": "Joyce",
"address": "joyce#example.com"
}
}
}
Step 2. The onlineMeetingUrl in the response event object is null.
{
...
"onlineMeetingUrl": null,
...
}
The onlineMeetingUrl property is not writable. We will update the documentation to reflect this.
Add these params in the request body
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
onlineMeetingUrl is null in response even while passing "isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"

Duplicate ID in PUT url when editing Restangular model in ui-router custom path

currently I'm setting up restangular to edit my model. Formerly it was ok when I'm not using custom url to show the form, like
http://example.com/admin/clients (I just load the form there).
But, then I use ui-router to setup the URL like this
http://example.com/admin/clients/{clientId}/edit
When I do model.put() or model.save(), the resulting PUT url is wrong. It become like this
PUT http://referral.dev/admin/clients/f2aa1490-5a8f-11e5-b936-b3a54e0c9925/f2aa1490-5a8f-11e5-b936-b3a54e0c9925
It should be like this:
PUT http://referral.dev/admin/clients/f2aa1490-5a8f-11e5-b936-b3a54e0c9925
What I do wrong?
For convenience, here is debug from restangular object:
{
"restangularCollection": false,
"$object": {
"id": "f2aa1490-5a8f-11e5-b936-b3a54e0c9925",
"referrer_id": "f1529d80-5a8f-11e5-8ca1-21124a5fa590",
"email": "Claudia.Kertzmann#hotmail.com",
"first_name": "Isabelle",
"last_name": "Herzog",
"mobile": "450.357.8579x621",
"stage": "member",
"stage_at": "2015-09-09 00:00:00",
"previous_stages": [
{
"stage": "lead",
"stage_at": "2015-08-30 00:00:00"
}
],
"total_investment": 190000,
"email_token": "caf34dddfe00f36b180d459236830934",
"confirmed": false,
"unsubscribed": false,
"transfered_at": null,
"previous_referrers": [],
"created_at": "2015-09-14 03:23:20",
"updated_at": "2015-09-14 03:23:20",
"referrer": {
"id": "f1529d80-5a8f-11e5-8ca1-21124a5fa590",
"email": "Eulalia.Pacocha#Dickens.biz",
"name": "Esperanza Aufderhar Sr.",
"mobile": "658.549.0277",
"role": "referrer",
"organization_id": "f0577b10-5a8f-11e5-984f-f120de15e3c1",
"last_login_at": "0000-00-00 00:00:00",
"suspended": 0
},
"route": "f2aa1490-5a8f-11e5-b936-b3a54e0c9925",
"reqParams": null,
"restangularized": true,
"fromServer": true,
"parentResource": {
"route": "admin/clients",
"parentResource": null
},
"restangularCollection": false
}
}
And, here is the restangular object if don't use custom URL (which working):
{
"id": "f2aa1490-5a8f-11e5-b936-b3a54e0c9925",
"referrer_id": "f1529d80-5a8f-11e5-8ca1-21124a5fa590",
"email": "Claudia.Kertzmann#hotmail.com",
"first_name": "Isabelle",
"last_name": "Herzog",
"mobile": "450.357.8579x621",
"stage": "member",
"stage_at": "2015-09-09 00:00:00",
"previous_stages": [
{
"stage": "lead",
"stage_at": "2015-08-30 00:00:00"
}
],
"total_investment": 190000,
"email_token": "caf34dddfe00f36b180d459236830934",
"confirmed": false,
"unsubscribed": false,
"transfered_at": null,
"previous_referrers": [],
"created_at": "2015-09-14 03:23:20",
"updated_at": "2015-09-14 03:23:20",
"referrer": {
"id": "f1529d80-5a8f-11e5-8ca1-21124a5fa590",
"email": "Eulalia.Pacocha#Dickens.biz",
"name": "Esperanza Aufderhar Sr.",
"mobile": "658.549.0277",
"role": "referrer",
"organization_id": "f0577b10-5a8f-11e5-984f-f120de15e3c1",
"last_login_at": "0000-00-00 00:00:00",
"suspended": 0
},
"route": "admin/clients",
"reqParams": null,
"restangularized": true,
"fromServer": true,
"parentResource": null,
"restangularCollection": false
}
I've tried manually set $object.route to "admin/clients" but the PUT url is still the same.
Thanks.. :)
I've solved it. Formerly I was using:
var models = Restangular.all('admin/clients');
Then use
models.one($stateParams.clientId).get()
to get the model.
The correct way, is use Restangular.one to load model, eg. like this:
vm.model = Restangular.one('admin/clients', $stateParams.clientId).get();

IBM Social Business Toolkit getContacts API Fails With 403 Forbidden

I used to be able to use the IBM SBT getContacts API from either a perl script (with authentication provided in the request) or an internet browser (authentication popup would appear) and it would return the data in JSON format as documented on the IBM Connections Developers API reference page:
http://www-10.lotus.com/ldd/appdevwiki.nsf/xpAPIViewer.xsp?lookupName=API+Reference#action=openDocument&res_title=Contacts_getContacts_API&content=apicontent&sa=true
Recently, however, the API call has been returning a 403 forbidden status. If I sign in to the IBM Connections Cloud before trying to use the API via a browser, it is converted to:
https://apps.na.collabserv.com/mycontacts/home.html
Does anyone know what I need to do to get the API to work again?
Thanks.
The best API to use are
https://apps.na.collabserv.com/lotuslive-shindig-server/social/rest/people/#me/#all?filterBy=type&filterOp=equals&filterValue=contacts&format=json
You'll get a list of the following entries back...
{
"photos":
[
],
"telephone": "",
"profileUrl": "",
"mobilephone": "",
"orgs":
[
{
"value": "CONTACTS",
"type": "Source"
},
{
"value": "Mentorship Expressway",
"type": "Org"
}
],
"website": "",
"id": "na.collabserv.com:contact:160000909070",
"fax": "",
"connectedToId": 201238541234,
"addresses":
[
],
"emailAddress": "asdfasdf#us.ibm.com",
"websites":
[
],
"objectId": 160000909070,
"type": "FRIEND",
"jobtitle": "",
"updated": "2014-07-01T16:44:21.000Z",
"ims":
[
],
"emails":
[
{
"value": "CONTACTS",
"type": "Source"
},
{
"title": "Primary Email",
"email": "asdfasdf#us.ibm.com"
}
],
"org":
{
"name": "Mentorship Expressway"
},
"displayName": "asdfasdf",
"address": "",
"companyId": 22285,
"phoneNumbers":
[
{
"value": "CONTACTS",
"type": "Source"
},
{
"title": "MOBILE",
"phone": "+ asdfasdf"
}
]
}

Resources