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

Similar Messages

  • How to POST (create) a folder using CMIS REST in Webcenter

    Has anyone tried to create a new folder using CMIS REST/Atom calls in Webcenter ?
    Here's what I try to do:
    http://172.31.100.150:7001/cmisrestprelim/cmis/children/MyContentServer ==>POST (using the REST client plug-in in Firefox)
    Content-Type=application/atom+xml
    <?xml version="1.0" encoding="utf-8"?>
    <entry xmlns="http://www.w3.org/2005/Atom"
    xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
    xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
    <title>mytestfolder</title>
    <cmisra:object>
    <cmis:properties>
    <cmis:propertyId propertyDefinitionId="cmis:objectTypeId"><cmis:value>cmis:folder</cmis:value></cmis:propertyId>
    </cmis:properties>
    </cmisra:object>
    </entry>
    This piece of code should create a folder called "mytestfolder" in the root directory.
    When I POST this, I get the following internal server error:
    <pre>javax.servlet.ServletException: com.sun.jersey.api.container.MappableContainerException: com.bea.content.RepositoryException: Please specify a valid ID object. Make sure the repository name is not null.
         at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:310)
         at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:314)
         at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:239)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.bea.content.manager.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:178)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
    Anyone has an idea how to solve this ?

    I must admit that I'm fairly new to all the CMIS and REST-things....
    So there are a couple of things in your answer that are a bit hazy to me.
    It looks like you are more familiar with all this.
    How do I find a creatable folder ? And what should be the URI to POST a new folder ?
    I try to POST a new folder using this URI:
    http://172.31.100.150:7001/cmisrestprelim/cmis/children/MyContentServer/IDC:Folder%2F13
    (IDC:Folder%2F13 is the /Contribution Folders/Documents folder in my repository)
    This POST keeps me giving the following internal server error:
    <pre>javax.servlet.ServletException: com.sun.jersey.api.container.MappableContainerException: com.bea.content.RepositoryException: Please specify a valid ID object. Make sure the repository name is not null.
         at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:310)
         at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:314)
         at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:239)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.bea.content.manager.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:178)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
    Thanks for helping me out.

  • 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

  • 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.

  • 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

  • Newly created Image not listed via REST API

    Hi,
    I have created a image in azure console .Its created successfully and i could see the created image under "Image" tab in console.Also, the image created with the name appending current date, it was not before.But when I am trying to list images by
    using the below REST API its listing images except the newly created images that have the  name appended with current date.
    https://management.core.windows.net/5f2fe4c3-23b3-45c0-a70c-9560b79dcf56/services/images
    header values:
    x-ms-version : 2012-03-01
    Content-Type : application/xml
    Host: management.core.windows.net
    This makes me fail to launch new VM via REST api.I got the response as follows
    <Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Code>BadRequest</Code><Message>The image vmyffdd-20140605-813455l does not exist.</Message></Error>
    Please look into this.

    hi,
    From the error, your request parameter was incorrect. I guess your image name may be wrong. How did you write your Image name and url? I suggest you don't forget the '.VHD'. Also,if you use the
    VMImageName element which is only available using version 2014-02-01 or higher
    And I suggest you could try this code sample about how to using REST api to create VM :Simple Windows Azure REST API Sample Tool
    Please try it.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Help/Example needed for creating JMSQueues/JMSTopics using the MBean API

    I am trying to create JMSQueues programmatically using the MBean API. When
    I use MBeanHome.createAdminMBean(), a queue appears in the root of the
    config file. This is progress, but the queue is in the wrong place! I need
    the queues to be part of my JMS server's "destinations" as seen on the
    console.
    So now I am trying to use createConfigurationMBean() instead, but I can't
    figure out what the "parent" parameter should be- no documentation! My
    first guess was that the parent might be the JMSServer, but that doesn't
    work.
    Anyone have example code to insert JMSQueues and JMSTopics into a specific
    JMS server's destinations?
    Here is the code I tried... All goes well until the final
    createConfigurationMBean call, where it throws a MBeanCreationException:
    // Get the MBeanHome bean
    Object obj = jndiContext.lookup("weblogic.management.adminhome");
    MBeanHome mbeanhome = (MBeanHome) javax.rmi.PortableRemoteObject.narrow
    (obj, MBeanHome.class);
    // Get the server MBean
    JMSServerMBean jmsServerMB =
    (JMSServerMBean)mbeanhome.getMBean("examplesJMSServer",
    JMSServerMBean.class);
    // Create the new Queue
    JMSQueueMBean jmsQMB = (JMSQueueMBean)mbeanhome.createConfigurationMBean
    ("weblogic.examples.jms.fooQueue", "JMSQueue", jmsServerMB);

    Ok, I still don't see how I can do it differently with the admin tool. If
    you want to see the commands I'm using, I can post them, but the basic one
    is shown below in the previous message. We're trying to set up a script so
    that developers can just run it and properly configure WebLogic with the
    right components.
    Thanks,
    Michelle
    "Michelle Baxter" <[email protected]> wrote in message
    news:[email protected]...
    I am using the weblogic.Admin tool, not doing this in code. I will attempt
    to translate your advice when I get time again.
    My commands look like this:
    java weblogic.Admin -url 127.0.0.1:7001 -username system -passwordweblogic
    CREATE -mbean "mydomain:Type=JMSQueue,Name=MyJMSQueue"
    I create this, I create the JMSServer MBean, then do and INVOKE (insteadof
    CREATE) and call the addDestination method, adding the JMS Queue MBeanthat
    I created previously, using the same naming scheme as in the above CREATE.
    "Viresh Garg" <[email protected]> wrote in message
    news:[email protected]...
    Daron Cole wrote:
    You can use createConfigurationMBean with JMSQueueConfig but in the
    end
    I used
    the code below to create a topic.The code that you posted is the right way to create queus/topics. alwayscreate admin mbeans to admin
    server and let admin server internally create config Mbeans on the
    managed
    server as per the
    location/targets that you set in admin Mbeans.
    Queue's are the same, just replace the word
    Topic with Queue and it should work. It should show up in the console
    app.
    MBeanHome home = (MBeanHome)ctx.lookup(MBeanHome.JNDI_NAME+".myserver");
    ServerMBean myserver =(ServerMBean)home.getMBean("myserver",ServerMBean.class);
    String topicName = "MyNewTopic";
    JMSServerMBean jmsServerMB =(JMSServerMBean)home.getMBean("JMSServer","JMSServer","mydomain");
    JMSTopicMBean jmsTopicMB =(JMSTopicMBean)home.createAdminMBean(topicName,"JMSTopic","mydomain");
    jmsTopicMB.setJNDIName(topicName);
    jmsServerMB.addDestination(jmsTopicMB);
    Viresh Garg
    Principal Developer Relations Engineer
    BEA Systems
    "Michelle Baxter" <[email protected]> wrote:
    There is no JMSQueueConfigMBean. What do you mean?
    "Daron Cole" <[email protected]> wrote in message
    news:[email protected]...
    Try JMSQueueConfig instead of JMSQueue.
    "Michelle Baxter" <[email protected]> wrote:
    Me too! I'm trying to use the weblogic.Admin class to set up
    queues
    and
    topics and the JMS server. The same results in the config file:
    the
    queues
    and topic were set up at the root, the JMS server was added, but
    no
    destinations, even though I invoked the addDestination method withthe
    created MBean queues and topic as arguments. No exceptions, just
    no
    destinations on the JMS server resulted. What's the right order ofexecution
    for this stuff??
    Thanks,
    Michelle
    "Jude DeMeis" <[email protected]> wrote in message
    news:[email protected]...
    I am trying to create JMSQueues programmatically using the MBean
    API.
    When
    I use MBeanHome.createAdminMBean(), a queue appears in the root
    of
    the
    config file. This is progress, but the queue is in the wrong
    place!
    I
    need
    the queues to be part of my JMS server's "destinations" as seen
    on
    the
    console.
    So now I am trying to use createConfigurationMBean() instead,
    but
    I
    can't
    figure out what the "parent" parameter should be- no
    documentation!
    My
    first guess was that the parent might be the JMSServer, but that
    doesn't
    work.
    Anyone have example code to insert JMSQueues and JMSTopics intoa
    specific
    JMS server's destinations?
    Here is the code I tried... All goes well until the final
    createConfigurationMBean call, where it throws aMBeanCreationException:
    // Get the MBeanHome bean
    Object obj =
    jndiContext.lookup("weblogic.management.adminhome");
    MBeanHome mbeanhome = (MBeanHome)javax.rmi.PortableRemoteObject.narrow
    (obj, MBeanHome.class);
    // Get the server MBean
    JMSServerMBean jmsServerMB =
    (JMSServerMBean)mbeanhome.getMBean("examplesJMSServer",
    JMSServerMBean.class);
    // Create the new Queue
    JMSQueueMBean jmsQMB =(JMSQueueMBean)mbeanhome.createConfigurationMBean
    ("weblogic.examples.jms.fooQueue", "JMSQueue", jmsServerMB);

  • 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.

  • Problem with creating customer account using TCA Java API

    Hi,
    I am trying to create customer account using TCA java API. i am getting exception saying PL/SQL numeric error: character to number conversion. but this error raises when calling API method
    HzCustAccountV2Pub.createCustAccount.
    can any body help me in solving this issue, any clue why this exception raises. i have tested even the code given in TCA API user guide. that code also gets same error.

    package client;
    import java.math.BigDecimal;
    import java.sql.Timestamp;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import oracle.jdbc.driver.OracleConnection;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    import oracle.apps.ar.hz.v2api.HzCustAccountV2Pub;
    import oracle.apps.ar.hz.v2api.HzPartyV2Pub;
    import oracle.apps.ar.hz.v2api.HzCustomerProfileV2Pub;
    class CreateCustAccount {
         public static void main(String[] args) throws Exception {
         HzCustAccountV2Pub.CustAccountRec p_cust_account_rec = new HzCustAccountV2Pub.CustAccountRec();
         HzPartyV2Pub.PersonRec p_person_rec = new HzPartyV2Pub.PersonRec();
         HzCustomerProfileV2Pub.CustomerProfileRec p_customer_profile_rec = new      HzCustomerProfileV2Pub.CustomerProfileRec();
         BigDecimal[] x_cust_account_id = new BigDecimal[1];
         String[] x_account_number = new String[1];
         BigDecimal[] x_party_id = new BigDecimal[1];
         String[] x_party_number = new String[1];
         BigDecimal[] x_profile_id = new BigDecimal[1];
         String[] x_return_status = new String[1];
         BigDecimal[] x_msg_count = new BigDecimal[1];
         String[] x_msg_data = new String[1];
         try
         Class.forName ("oracle.jdbc.driver.OracleDriver");
         OracleConnection conn = (OracleConnection) DriverManager.getConnection ("jdbc:oracle:thin:@ebiztst.trianz.int:1526:PATCH","apps","apps");
         HzCustAccountV2Pub custaccountV2Pub = new HzCustAccountV2Pub();
         p_cust_account_rec.account_name = "John Ac";
         p_person_rec.person_first_name = "John";
         p_person_rec.person_last_name = "Smith";
         p_cust_account_rec.created_by_module = "TCA_EXAMPLE";
         HzCustAccountV2Pub.createCustAccount(
         conn
         , "T"
         , p_cust_account_rec
         , p_person_rec
         , p_customer_profile_rec
         , "F"
         , x_cust_account_id
         , x_account_number
         , x_party_id
         , x_party_number
         , x_profile_id
         , x_return_status
         , x_msg_count
         , x_msg_data
         System.out.println( "x_return_status = " + x_return_status[0] );
         System.out.println( "x_msg_count = " + x_msg_count[0] );
         System.out.println( "x_msg_data = " + x_msg_data[0]);
         if (x_msg_count[0].intValue() > 1) {
              OracleCallableStatement ocs = null;
              for (int i=0; i<x_msg_count[0].intValue(); i++) {
              ocs = (OracleCallableStatement)conn.prepareCall(
              "begin ? := fnd_msg_pub.get( p_encoded => ’F’ ); end;");
              ocs.registerOutParameter(1, OracleTypes.VARCHAR);
              ocs.execute();
              System.out.println((i + 1) + ". " + ocs.getString(1));
              conn.close();
              } catch (ClassNotFoundException e) {
              System.out.println("Driver Not Found: " + e);
              } catch (SQLException e) {
              System.out.println("SQL Error." + e);
    }

  • How to create Authorization policy using OIM 11g API

    Hi,
    Could you please let me know how to create Authorization policy using OIM 11g API.
    Thanks

    Constructing A Policy Programmatically
    http://docs.oracle.com/cd/E27559_01/dev.1112/e27154/cons_policy_prog.htm#CHDHACBF
    api ref for PolicyStore
    http://docs.oracle.com/cd/E21764_01/apirefs.1111/e22649/oracle/security/jps/service/policystore/PolicyStore.html#createApplicationPolicy_java_lang_String_
    something like below code to start with
    try {
    JpsContextFactory ctxFact;
    ctxFact = JpsContextFactory.getContextFactory();
    JpsContext ctx;
    ctx = ctxFact.getContext();
    PolicyStore ps = ctx.getServiceInstance(PolicyStore.class);
    if (ps == null) {
    // if no policy store instance configured in jps-config.xml
    System.out.println("no policy store instance configured");
    return;
    ApplicationPolicy ap = ps.createApplicationPolicy("Trading", "Trading
    Application","Trading Application.");
    } catch (JpsException e) {
    }

  • HTTP Response Status Codes: GET (retrieve), POST (create), PUT (modify), and DELETE (REST, Bulk, Any API)

    Many of us, who are starters, starting to wonder when reading any API documentations or starting out with your first program built to make any of the API calls, what do all error codes means, when I get many different types of response from running the program/script. The only reason I thought about sharing this is because I know how motivation plays a key role when dealing with Eloqua platform and building components on top. This extends the functionality beyond what is already out of the box.
    I put together a table that explains these in details. I hope you can benefit in resolving issues as you venture in your journeys. This is a very common chart that can be seen across many platform REST APIs. Idea was to have it here because the audience are not always the same.
    Response Code
    HTTP Operation
    Response Body Contents
    Description
    200
    GET, PUT, DELETE
    Resource
    No error, operation successful.
    201 Created
    POST
    Resource that was created
    Successful creation of a resource.
    202 Accepted
    POST, PUT, DELETE
    N/A
    The request was received.
    204 No Content
    GET, PUT, DELETE
    N/A
    The request was processed successfully, but no response body is needed.
    301 Moved Permanently
    GET
    XHTML with link
    Resource has moved.
    303 See Other
    GET
    XHTML with link
    Redirection.
    304 Not Modified
    conditional GET
    N/A
    Resource has not been modified.
    400 Bad Request
    GET, POST, PUT, DELETE
    Error Message
    Malformed syntax or a bad query.
    401 Unauthorized
    GET, POST, PUT, DELETE
    Error Message
    Action requires user authentication.
    403 Forbidden
    GET, POST, PUT, DELETE
    Error Message
    Authentication failure or invalid Application ID.
    404 Not Found
    GET, POST, PUT, DELETE
    Error Message
    Resource not found.
    405 Not Allowed
    GET, POST, PUT, DELETE
    Error Message
    Method not allowed on resource.
    406 Not Acceptable
    GET
    Error Message
    Requested representation not available for the resource.
    408 Request Timeout
    GET, POST
    Error Message
    Request has timed out.
    409 Resource Conflict
    PUT, PUT, DELETE
    Error Message
    State of the resource doesn't permit request.
    410 Gone
    GET, PUT
    Error Message
    The URI used to refer to a resource.
    411 Length Required
    POST, PUT
    Error Message
    The server needs to know the size of the entity body and it should be specified in the Content Length header.
    412 Precondition failed
    GET
    Error Message
    Operation not completed because preconditions were not met.
    413 Request Entity Too Large
    POST, PUT
    Error Message
    The representation was too large for the server to handle.
    414 Request URI too long
    POST, PUT
    Error Message
    The URI has more than 2k characters.
    415 Unsupported Type
    POST, PUT
    Error Message
    Representation not supported for the resource.
    416 Requested Range Not Satisfiable
    GET
    Error Message
    Requested range not satisfiable.
    500 Server Error
    GET, POST, PUT
    Error Message
    Internal server error.
    501 Not Implemented
    POST, PUT, DELETE
    Error Message
    Requested HTTP operation not supported.
    502 Bad Gateway
    GET, POST, PUT, DELETE
    Error Message
    Backend service failure (data store failure).
    505
    GET
    Error Message
    HTTP version not supported.
    Hope this helps. Original post: REST API Status Codes and Complete REST API Tutorial with Status Codes.
    Thank
    Amit

    Hi, I am trying to PUT to update contact info and I get following error:
    2015-01-16 11:00:17,970 INFO [main] oracle.eloqua.connector.eloqua.EloquaConnector.putWithBasicAuth(97) | accessHttpsPut.url=https://secure.eloqua.com/API/REST/2.0//data/contact/7606838, text={"id":"7606838","accountName":"openIdStr001","emailAddress":"[email protected]","type":"Contact"}
    2015-01-16 11:00:18,931 ERROR [main] oracle.eloqua.connector.eloqua.EloquaConnector.putWithBasicAuth(140) | ClientProtocolException
    org.apache.http.client.HttpResponseException: Request is malformed.
    Is there any idea?
    Thanks so much.
    Sincerely.

  • 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

  • Error while creating authorisation policy using OIM 11g API

    Hi,
    We have a requirement to create ‘Authorization Policies’ (assign Data Constraints, Permissions & Assignments) using OIM 11g API’s.  I am using ‘oracle.iam.authzpolicydefn.api.PolicyDefinitionService & oracle.iam.authzpolicydefn.vo.AuthzPolicy’.  But when I am trying to attach Entity/Feature (User Management) to authorisation policy, it is throwing exception.  Below is the code snippet which I am trying to implement.
    Line1: PolicyDefinitionService policyService = oimClient.getService(PolicyDefinitionService.class);
    Line2: AuthzPolicy authPolicy = new AuthzPolicy();
    Line3: authPolicy.setName("Test Authz Policy");
    Line4: authPolicy.setDisplayName("Test Authz Policy Dsp Name");
    Line5: authPolicy.setDescription("Test Authz Policy Description");
    Line6: Feature feature = oimClient.getService(Feature.class);
    Line7: Action featureAction = feature.getAction(FeatureManagerConstants.Features.USER_MGMT.getId());
    Line8: List<Action> actions = new ArrayList<Action>();
    Line9: actions.add(featureAction);
    Line10: authPolicy.setActions(actions);
    Line11: policyService.createPolicy(authPolicy);
    Exception: oracle.iam.platform.utils.NoSuchServiceException: java.lang.ClassNotFoundException: oracle.iam.authzpolicydefn.api.FeatureDelegate
    The above exception is throwing at Line6.
    Let me know if anyone implemented.
    - Kalyan Mutya

    If you are using JDeveloper , can you able to get class after giving "." .If yes no than it is the problem with the jar file you are using .Check whether you can able to import oracle.iam.authzpolicydefn.api.Feature.
    Thanks ,
    Animesh anand

Maybe you are looking for

  • Clearing with Vendor.

    Dear Expert, When we clear Vendor open items with Customer opern items either the reconciliation accounts are effected with the transaction amount or not. Regards Aly Lakson Group, Pakistan

  • Weblogic Portal 10.3.6 Implementing Fork

    We are having a requirement of implementing multiple portlets running parallel to improve the performance. But, there are some inter-dependencies between 'some' of the portlets. We tried implementing FORK for the portlets in order to execute the port

  • Photoshop Touch SDK for iOS Bugs and annoyances

    I've just finished implementing the "Touch" capability in my iOS app. As I can't find anywhere to post bug reports, and this may help others, here's my experience: BUGS: 1. sendImage in psconnection is multiply broken: (a) Network communication depen

  • Use JAXP for creating XML document

    Hi, I have used JAXP to create a XML docuemnt. But when I use Jaxp to parse it, it returns parsing error ''null''. I open the XML document in XMLspy and save again, then it can be parsed. Any suggestion for that? Thanks a lot.

  • Forms Developer & Workflow Builder

    All, Can any one tell me the patch number to download the Forms 10G developer & Workflow Builder for 12i from Metalink. Thanks -