Welcome to my blog, stay tunned :
Home | Blogs | Stephane Eyskens's blog

Creating a micro blog with new hashtags with the REST API

Hi,

Update 04/2013 download my demo App at http://sptoolbasket2013.codeplex.com/

Similarly to my previous post, here is how to create a new hashtag inside of a microblog using the REST API from a SharePoint-Hosted App. Basically, you also have to address the ContentItems

collection and to create the hashtag by setting ItemType to 3 and Text to the value of your hashtag.

{
    'restCreationData': {
        '__metadata': {
            'type': 'SP.Social.SocialRestPostCreationData'
        },
        'ID': null,
        'creationData': {

            '__metadata': {
                'type': 'SP.Social.SocialPostCreationData'
            },
            'Attachment': null,
            'ContentItems': {
                'results': [
                    {
                        '__metadata': {
                            'type': 'SP.Social.SocialDataItem'
                        },
                        'Text': '#newnewtag',
                        'ItemType': 3                        
                    }                                    
                ]
            },
            'ContentText': 'New tag is here {0} ',
            'UpdateStatusText': false
        }
    }
}

Here is how it's looking like:

Happy Coding