Using Parse REST APIs

I know that you will recommend me to download
Parse .Net SDK.
But the problem is that it uses Tasks which are only available in .Net 4.5
The older versions of .Net are not supported.
That is why I am going to use parse REST APIs.
Having a problem in understanding.
Here is how to create parse object:
https://parse.com/docs/rest#objects-creating
curl -X POST \
-H "X-Parse-Application-Id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "X-Parse-REST-API-Key: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
https://api.parse.com/1/classes/GameScore
I don't know how to add "-d" string(JSon) to the request.
I tried and here is my code:
Using client As New WebClient
Dim values As New NameValueCollection
values("X-Parse-Application-Id") = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
values("X-Parse-REST-API-Key") = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
values("Content-Type") = "application/json"
Dim response = client.UploadValues("https://api.parse.com/1/classes/GameScore", values)
Dim str = System.Text.Encoding.Default.GetString(response)
End Using
And it is returning this error: (401) Unauthorized
Allow time to reverse.

But I got the answer and want to help the others.
Dim request As WebRequest = WebRequest.Create("https://api.parse.com/1/classes/GameScore")
request.Headers("X-Parse-Application-Id") = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
request.Headers("X-Parse-REST-API-Key") = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
request.ContentType = "application/json"
request.Method = "POST"
Dim bytes = System.Text.Encoding.GetEncoding("UTF-8").GetBytes("{""score"":1337,""playerName"":""Sean Plott"",""cheatMode"":false}")
Dim stream = request.GetRequestStream
stream.Write(bytes, 0, bytes.Count)
stream.Close()
Dim response = request.GetResponse
Dim stream2 = response.GetResponseStream
Dim bytes2(response.ContentLength - 1) As Byte
stream2.Read(bytes2, 0, bytes2.Count)
stream2.Close()
response.Close()
Dim s = System.Text.Encoding.Default.GetString(bytes2)
MsgBox(s)
Allow time to reverse.

Similar Messages

  • How to create a campaign based on a template using the REST API

    Hi CodeIt-ers,
    I'm using the REST API to create campaigns in Eloqua 10, all works well except for 1 thing: I can't seem to create a campaign based on an existing Campaign template.
    Based on the documentation on REST API - Accessing Campaigns I've tried using "sourceTemplateId" (code snippet below) but that did not do the trick.
    Does that functionality simply not work or am I missing something?
    Thanks!
    Ferry
    $campaign_data = new Campaign(); 
    $campaign_data->sourceTemplateId='442';
    $campaign_data->folderId='1137';
    $campaign_data->currentStatus='draft';

    Hi Richard,
    Unfortunately no. I reached out to support, they informed me "sourceTemplateId" could not be used to create new campaigns based on a template, instead they advised to use the "Elements " property as shown in this example: Eloqua REST API - Create a Campaign with a Segment and Email
    Thanks
    Ferry

  • How to use search REST api to get custom managed property data for anonymous user?

     
    I am trying build a public portal with anonymous access and i am trying to read some
    content from custom managed property using search REST api in sharepoint 2013. I have tried to enable all possible attributes of the managed prop. Like searchable,queryable,safe etc. also i am including queryparametertemplate in my REST api search query. But
    still i am not able to retrieve the managed prop. For an anonymous user. The same query returns the value if i am logged in.
    Any Help is greatly appreciated. 
    Thanks,
    Rakesh
    Thanks, Rakesh

    Hi Rakesh,
    To enable anonymous Search REST queries, we need to create queryparametertemplate.xml and upload it to the correct library in SharePoint.
    From your description I can know that you have created the file, then I recommend to check the things below:
    Please use “QueryTemplatePropertiesUrl” instead of “queryparametertemplate” in the Search REST API query as following: &QueryTemplatePropertiesUrl='spfile://webroot/queryparametertemplate.xml'.
    Make sure that the Query Properties you need have been added to the QueryProperties element in the queryparametertemplate.xml file.
    Make sure that the query parameters you need have been added to the WhiteList element in the
    queryparametertemplate.xml file. For example, if you want to use Refiners in the REST API, then the Refiners should be added to the
    WhiteList element in the queryparametertemplate.xml file as following:
    <a:string>Refiners</a:string>.
    You can also debug setting properties in anonymous Search Rest queries following the link below:
    http://www.mavention.com/blog/debugging-setting-properties-anonymous-search-rest-queries
    More references about anonymous Search REST:
    http://blog.mastykarz.nl/configuring-sharepoint-2013-search-rest-api-anonymous-users/
    http://msdn.microsoft.com/en-us/library/office/jj163876%28v=office.15%29.aspx#bk_AnonymousREST
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Capturing Hosts,cluster,ad Resource information of hosts using SPF REST API

    Hi,
    We are using SCVMM 2012R2 to integrate Hyper-V VMM with java using SPF REST API.For this I am using tenant API. 
    I am able fetch all the entities in VMM using GET query in SPF URL,but I am unable to fetch hosts,cluster and resource information for hosts.
    Can anyone please tell me how will I fetch this information with REST API or does there any other way exists.
    If so please tell  me with the example.
    Thank you.

    Hi ,
    SPF only covers Tenant actions and information. There is no information about hosts and clusters that can be get from SPF.

  • How to retrieve the users that are following a document using JSOM / REST APIs in SharePoint 2013

    Hi everyone,
    Does anyone know how to use JSOM / REST APIs to retrieve the users that are following a specific document in SharePoint 2013? 
    Thanks in advance,
    Nam

    Hi Nam,
    Please use the sample code to get the followers for the document. Courtesy: Mokhtar
    Bepari 
    using Microsoft.SharePoint.Client;
    using Microsoft.SharePoint.Client.Social;
    ClientContext clientContext = new ClientContext("http://URL");
    SocialFollowingManager followingManager = new SocialFollowingManager(clientContext);
    SocialActorInfo actorInfo = new SocialActorInfo();
    actorInfo.ContentUri = "<documenturl>"; //set the document url.
    actorInfo.ActorType = SocialActorType.Document;
    //By using the GetFollowed method you can get the people who the current user is following.
    ClientResult < SocialActor[] > followedResult = followingManager.GetFollowed(SocialActorTypes.Users);
    //By using the GetFollowers() method you can get the people who are following the current user.
    ClientResult < SocialActor[] > followersResult = followingManager.GetFollowers();
    clientContext.ExecuteQuery();
    Once you get the resultset you can iterate like below:
    foreach(SocialActor actor in followedResult)
    string name = actor.Name;
    string imageURL = actor.ImageUri;
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Anyone got any experience using Flash with the Parse REST API?

    Just wondered if anyones used the Parse.com REST API AS3 library ? if so any tips or advice on what it's good or not good for?

    It is good to hear that is getting Apple feedback from other sides regarding that network problem. I always thought that this just matters for bigger studios with multiple rooms and network installations and therefore not that a high priority for Apple. It never occurred to me that in a networked school environment that is a big issue and last time I checked Apple pretended to to care about the educational market.
    If you really need the network setup to work with Logic and can't wait for Apple to fix it, try to mount the network volumes via the smb protocol instead of the afp protocol. I used it for a while under Logic 7 and it worked, haven't tried it under L8. However keep in mind that are some drawbacks:
    Besides minor user interface limitations (color, icons, etc), the main problem is some boneheaded setup in Logic. Get that:
    Logic saves the path to any related media file, which is ok, but it saves also the network protocol it uses! If you logged on to a network volume over smb and use an audio file, Logic will save the complete path, something like "smb://MediaVolume/audio/MyGroove.aif". Netx time you mount the MediaVolume drive via afp and open your Logic Project, it won't find that file, or automount that volume again as an smb volume. So now you have the same network volume mounted twice, via afp and smb.
    Now you can see why I backed away from that solution.

  • Using the REST API for files, how do I get information on all the folders and files in a folder?

    I have an app that can successfully get a list of a folders content. However, by default the list is limited to 200 entries. I luckily ran into this limit when getting the list on a folder that contained 226 entries and realized I needed to then request
    a list of the next items but it wasn't obvious from the REST API document how to do that. I tried sending the skipToken query parameter and setting it to 0 initially and incrementing each time I sent the request but always got the same 200 items back. So,
    how do I get the list of files and folders beyond the initial list?

    In SP2013 the skiptoken query parameter does not work with list items. You can look at the link below which discusses using the "__next" parameter.
    http://stackoverflow.com/questions/18964936/using-skip-with-the-sharepoint-2013-rest-api
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • Post/Create a poll using Yammer REST API

    Hi everybody,
    I have been working on a project where there is a requirement to develop a custom web part that displays the feeds from Yammer. Also, the logged in user should be able to post messages, attachments, polls from the web part.
    I was able to post messages and attachments using rest api and with yammer embed. But I couldn't find any information/documentation on how to post/create a poll via Yammer API using JavaScript. I've browsed through the documentation provided by Yammer( https://developer.yammer.com/documentation/ )
    and googled a lot, but couldn't get any help.
    Any suggestions regarding this would be highly appreciated.
    Regards,
    Srivikas Nallamilli.
    -- Thanks & Regards, Srivikas.

    Hi,
    Use the same API that you use to fetch messages from yammer i.e https://www.yammer.com/api/v1/messages.json
    When you post a poll, above api will return json respose something as below:
    "external_references":[
    "meta":{
    "requested_poll_interval":60,
    "realtime":{
    "uri":"https://7-791.rt.yammer.com/cometd/",
    "authentication_token":<TOKEN>
    "channel_id":<CHANNEL ID>
    "last_seen_message_id":null,
    "current_user_id":1530316230,
    "followed_references":[
    "ymodules":[
    "id":12147685,
    "inline_html":"<INLINE HTML>",
    "viewer_id":1530316230
    "newest_message_details":null,
    "feed_name":"Company Feed",
    "feed_desc":"",
    "direct_from_body":false
    you will get the poll message in inline html section highlighted in code above.
    Let me know if it works.
    Thanks,
    Avni Bhatt
    If this helped you resolve your issue, please mark it Answered

  • How to fetch all the contact fields using Office365 REST API

    When I request for Contacts using webservices URL, Office365 returns only some specific fields (even though contact record has lot more fields). Is there any way so that I can fetch all the fields in contact record?

    Currently the REST APIs are limited to the fields you see now. We're constantly working to add more features though, so that might come in the future.

  • How to use WebCenter REST API to like or comment a activity

    Hi all
    I want to know how to realize like or comment function with REST APIs.
    I execute a REST call with following url, but the 'like' counter is not be increased.
    http://cdcjp77vm3.cn.oracle.com:8888/rest/api/activities/services/oracle.webcenter.community/objectTypes/groupSpace/objects/(s2518c69b_1989_4a63_8886_c32075c76b9c)/likes?&utoken=FDNA-Z7ekZuPnVSNoPWOqTJ2IzAE_w**
    Is there anything i missed?
    Can anyone give me an example about how to use this API to like or comment a activity?
    Thanks
    Qian

    So Qian;
    looking through the code this is how you can
    Post a comment (POST)
    /rest/api/activities/services/{serviceId}/objectTypes/{objectType}/objects/({objectId})/comments?startIndex={startIndex}&itemsPerPage={itemsPerPage}&utoken=blah
    {key:val}
    {text:'this is my comment)
    Edit a comment (PUT)
    So I haven't tried it but it should do the trick.. although I don't see update under capabilities so you may get blocked.
    /rest/api/activities/services/{serviceId}/objectTypes/{objectType}/objects/({objectId})/comments?startIndex={startIndex}&itemsPerPage={itemsPerPage}&utoken=blah
        id: {commentId},
        text: 'changed my comment.. magic'
    Delete a comment (DELETE)
    /rest/api/activities/services/{serviceId}/objectTypes/groupSpace/objects/({objectId})/comments/{commentId}?utoken=blah
    Like POST
    /rest/api/activities/services/{serviceId}/objectTypes/{objectType}/objects/({objectId})/likes?startIndex={startIndex}&itemsPerPage={itemsPerPage}&utoken=blah
    I passed it an empty object {} seemed to work for me.
    Unlike (DELETE)
    /rest/api/activities/services/oracle.webcenter.community/objectTypes/groupSpace/objects/({objectId})/likes/({likeId})?utoken=blah
    Let me know if this works for you

  • Query a document library using Search Rest API

    How can we search for a specific document library using SharePoint Search through Rest API? We have a couple of document libraries which have thousands of documents with its relevant metadata information stored. We need to create an app to search through
    these document libraries and display the document and its metadata. Can someone point me in the right direction?
    V

    Taking what Shakir said you would substitute queryText with a managed property query (KQL) to query against metadata from the Document library. So if your document library has a Owner column then you would either create or use an existing managed property
    defined in the Search Schema. So your query may look like this:
    https://<site URL>/_api/search/query?querytext='(owner:smith)+AND+(path:<library url>)'
    Link:
    https://msdn.microsoft.com/en-us/library/office/ee558911.aspx?f=255&MSPPError=-2147217396
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • Office 365 API with Visual studio 2013 using file REST API

    Hi,
    I had configured MVC application for getting files from office 365 one drive, I am able to seen all file on last day but Now I am getting below issue 
    <?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code>-1, System.ApplicationException</m:code><m:message xml:lang="en-US">Error
    in the application.</m:message></m:error>
    when I want to see again all files. and most important I didn't make any changes in my previous code...
    Please share your suggestion....

    Hi,
    If you are developing an app for SharePoint, the app can call into a user’s MySite site collection and access their OneDrive for Business documents using REST or CSOM.
    The REST call to get to the file would be:
    https://YourO365DomainHere-my.sharepoint.com/personal/YourUserName_YourO365DomainHere_onmicrosoft_com/_api/web/GetFileByServerRelativeUrl('/personal/YourUserName_YourO365DomainHere_onmicrosoft_com/Documents/Shared%20with%20Everyone/myDocument.docx')/$value
    More information is here:
    http://blogs.msdn.com/b/sharepointdev/archive/2013/08/13/access-skydrive-pro-using-the-sharepoint-2013-apis.aspx
    Best regards
    Dennis Guo
    TechNet Community Support

  • How to create list items with multiple attachment files using rest api javascript

    In one of user form I am using javascript rest api to create a list item with multiple attachment files. So far I am able to create list item and once created uploading an attachment file. But this is two step process first create an item and then upload
    a file.
    It create an additional version of the item which is not desired. Also I am not able find a way to attach multiple files in a go. Following is the code I am using.
    createitem.executeAsync({
                    url: "/_api/web/lists/GetByTitle('UserForm')/items(1)/AttachmentFiles/add(FileName='" + aFile.name + "')",
                    method: "POST",
                    contentType: "application/json;odata=verbose",
                    headers: {
                        "Accept": "application/json;odata=verbose",
                        "X-RequestDigest": $("#__REQUESTDIGEST").val()
                    binaryStringRequestBody: true,
                    body: fileContent,
                    success: fnsuccess,
                    error: fnerror
    So somehow I need to combine item attributes along with attachment files in body: param. I visited https://msdn.microsoft.com/en-us/library/office/dn531433.aspx#bk_ListItem but no success.
    Appreciate any help.

    Thanks Mahesh for the reply and post you share it was useful.
    But this does not solve the core of the issue. You are uploading attachments after creation of item and multiple files are being attached in loop. This is kind of iterative update to an existing item with attachments. This will end up creating multiple versions. 
    What I am trying to achieve is to create an item along with multiple attachments in a go. No item updates further to attach a file.
    Please suggest how this can be done in one go. SharePoint does it when one creates an item with multiple attachment.
    Thanks for your reply.

  • Best practice for development using REST API - OData

    Hi All, I am new to REST. I am a developer who works mostly in server-side code using Visual Studio. Now that Microsoft is advocating to write code using REST API instead of server-side code or client side object model, I am trying to use REST API.
    I googled and most of the example shows to write a code and put it on Content Editor/Script Editor. How to organize code and deploy to the staging/production in this scenario? Is there any Best Practice or example around this?
    Regards,
    Khushi

    If you are writing code in aspx or cs it does not mean that you need to deploy it in the SharePoint server, it could be any other application running from your remote server. What I mean it you can use C# & Rest API to connect to SharePoint server.
    REST API in SharePoint 2013 provides the developers with a simple standardized method of retrieving information from SharePoint and it can be used from any technology that is capable of sending standard HTTP requests.
    Refer to the following blog that provide your more details about comparison of the major features of these programming choices/
    http://msdn.microsoft.com/en-us/library/jj164060.aspx#RESTODataA
    http://dlr2008.wordpress.com/2013/10/31/sharepoint-2013-rest-api-the-c-connection-part-1-using-system-net-http-httpclient/
    Hope this helps
    --Cheers

  • Performance issue during SharePoint list data bind to html table using Ajax call(Rest API)

    Hello,
    I am having multiple lists in my SharePoint Site. I am using SharePoint REST APIs to get data from these lists and bind a HTML Table. Suppose, I have 5 lists with 1000 records each, I am looping 5000 times to bind each row(record) to this html table. This
    is causing performance issue which is taking a very long time to bind. 
    Is there any way So that I can reduce this looping OR is there any better approach to improve the performance. Please kindly Suggest.  Thank you for your help :)
    Warm Regards,
    Ratan Kumar Racha

    Hi Racha,
    For handling large data binding in a page,
    AngularJS would be a great option if you might would worry about the performance.
    You can get more information about using AngularJS from the two links below:
    https://www.airpair.com/angularjs/posts/angularjs-performance-large-applications
    http://www.sitepoint.com/10-reasons-use-angularjs/
    Best regards
    Patrick Liang
    TechNet Community Support

Maybe you are looking for

  • Is there a way to disable the AppleTV remote control on a MacBook?

    I often work on my MacBook Pro while watching shows using Apple TV, but every time I pause or play something on the AppleTV, the remote signal also activates iTunes on my MacBook Pro.  I pretty much never use the remote to control my MacBook Pro.  Is

  • Server returned HTTP response code: 401 for URL

    i am trying to execute the following piece of code from a remote client: URL url = new URL("www.abc.com/servlet/someservlet"); URLConnection conn = url.openConnection(); but i am getting a server returned 401 error, i did some research and i think my

  • Create/Delete a text file

    How can I create a text file before writing sth into it? And how to delete it afterwards??

  • Supported IPTC Fields in Aperture 3.3

    Does anyone know what the current state of IPTC support in Aperture is as of 3.3. Is there a document anywhere that specifies which fields are / are not supported ? Thx

  • OA Custom Page Import

    Hi, I tried importinga custom page using XMLImporter. the cosole message was "Import Succeded". i havent restarted the webserver. still wont it be available in the mds repository ? jdr_utils.listContents is not listing the page. is this normal ? than