Unauthorized Issue in invoking REST API

Hi,
I am getting the following issue when i am calling the "GET" method of REST API:" https://secure.p03.eloqua.com/API/bulk/2.0/syncs/14"
Unauthorized
java.lang.RuntimeException: Failed : HTTP error code : 401
  at GetContactSync.main(GetContactSync.java:41)
This is the code i have used to invoke the API:
String proxyhost="www-proxy.us.oracle.com";
  int  proxyport=80;
  String inputparam="14";
    String urlstring="https://secure.p03.eloqua.com/API/bulk/2.0/syncs/14";
   String authString = "IBUDEMO\\aman.adarsh" + ":" + "Welcome@1";
  //String authString = "IBUDEMO1\\aman.adarsh" + ":" + "Welcome@1";
   String authToken = "Basic" + javax.xml.bind.DatatypeConverter.printBase64Binary(authString.getBytes());
   String output="";
   String line="";
  URL url = new URL(urlstring);
  //Properties systemProperties = System.getProperties();
  //systemProperties.setProperty("http.proxyHost",proxyhost);
  HttpURLConnection conn = (HttpURLConnection) url.openConnection(new Proxy(Type.HTTP,new InetSocketAddress(proxyhost, proxyport)));
  conn.setInstanceFollowRedirects(false);
  conn.setDoOutput(true);
  conn.setRequestMethod("GET");
  conn.setRequestProperty("Accept", "application/json");
  //conn.setRequestProperty("Authorization", authToken);
  conn.setRequestProperty("Proxy-Authorization", "Basic " + authToken);
  System.out.println(conn.getResponseMessage());
  if (conn.getResponseCode() != 200) {
            throw new RuntimeException("Failed : HTTP error code : " +
                                       conn.getResponseCode());
I want to know if i have missed any parameter
The same authentication piece of code is working fine for "POST" methods of other API's
Request your help on this

Hi,
I am getting the following issue when i am calling the "GET" method of REST API:" https://secure.p03.eloqua.com/API/bulk/2.0/syncs/14"
Unauthorized
java.lang.RuntimeException: Failed : HTTP error code : 401
  at GetContactSync.main(GetContactSync.java:41)
This is the code i have used to invoke the API:
String proxyhost="www-proxy.us.oracle.com";
  int  proxyport=80;
  String inputparam="14";
    String urlstring="https://secure.p03.eloqua.com/API/bulk/2.0/syncs/14";
   String authString = "IBUDEMO\\aman.adarsh" + ":" + "Welcome@1";
  //String authString = "IBUDEMO1\\aman.adarsh" + ":" + "Welcome@1";
   String authToken = "Basic" + javax.xml.bind.DatatypeConverter.printBase64Binary(authString.getBytes());
   String output="";
   String line="";
  URL url = new URL(urlstring);
  //Properties systemProperties = System.getProperties();
  //systemProperties.setProperty("http.proxyHost",proxyhost);
  HttpURLConnection conn = (HttpURLConnection) url.openConnection(new Proxy(Type.HTTP,new InetSocketAddress(proxyhost, proxyport)));
  conn.setInstanceFollowRedirects(false);
  conn.setDoOutput(true);
  conn.setRequestMethod("GET");
  conn.setRequestProperty("Accept", "application/json");
  //conn.setRequestProperty("Authorization", authToken);
  conn.setRequestProperty("Proxy-Authorization", "Basic " + authToken);
  System.out.println(conn.getResponseMessage());
  if (conn.getResponseCode() != 200) {
            throw new RuntimeException("Failed : HTTP error code : " +
                                       conn.getResponseCode());
I want to know if i have missed any parameter
The same authentication piece of code is working fine for "POST" methods of other API's
Request your help on this

Similar Messages

  • REST API event-source-status pagesize

    Hi,
    I'm having an issue with the REST API method event-source-status
    I want to get the method to return a list of all the attached event
    sources. I have about 1400 attached to Sentinel but on calling the
    method only 400 entries are returned.
    On my test env (I have 4 event sources) I have tried to modify my script
    to call event-source-status?pagesize=1 with the intention to read 1
    object, then effectively going to the next. However the results via
    postman appear to show that with a pagesize of 1 that 4 items are
    returned with 1 next link, and on pressing next the same 4 items are
    returned.
    All I want to do is iterate through all event sources but dont seem to
    be able to get them all in 1 list or get them in the pagesize I
    require.
    Any help welcome.
    srobshaw
    srobshaw's Profile: https://forums.netiq.com/member.php?userid=2823
    View this thread: https://forums.netiq.com/showthread.php?t=51745

    Hi,
    If you would like to iterate through all the event sources in a
    paginated manner, use this URL:
    1. To get all the event sources attached:
    /SentinelRESTServices/objects/eventsource
    2. To get N-number(Say 5) event sources / per page:
    /SentinelRESTServices/objects/eventsource?page=1&pagesize=5 (This comes
    with next url which would look like, <next
    xlink:href="https://164.99.175.172:8443/SentinelRESTServices/objects/eventsource?page=2&pagesize=5"/>).
    In above example, the 'page' attribute is for the page number you are
    querying for.
    and the 'pagesize' is the number of elements you would like to retrieve
    in the page you mentioned by 'page' attribute.
    You should be able to crawl through event sources with the next and prev
    url.
    I have tested it with Sentinel 7.2 and found working as expected.
    In your query above, you have mentioned about
    /SentinelRESTServices/objects/event-source-status url.
    To get all the event sources' status just call
    /SentinelRESTServices/objects/event-source-status (without any page
    attribute).
    Let us know if both the REST EP(/objects/eventsource and
    /objects/event-source-status) works for you as expected.
    In your query
    atapas
    atapas's Profile: https://forums.netiq.com/member.php?userid=8144
    View this thread: https://forums.netiq.com/showthread.php?t=51745

  • OneDrive for Business REST API - PUT,POST - 401 Unauthorized

    Hi,
    We've a trial version of Microsoft azure and are playing with the One drive for Business CRUD operations via the REST
    API from java client as per the link : https://msdn.microsoft.com/en-us/office/office365/api/files-rest-operations
    After getting the token, i'm able to list any folder, download file and get attributes of a file using GET successfully.
    But, the operations such as PUT, POST which are required for create folder, upload file,  rename file/folder, etc are not working. I get back "401 UnAuthorized" error.
    Error Response json : 
    {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":"Access denied. You do not have permission to perform this action or access this resource."}}
    I set the access token in the similar way how i set for GET in the http request and i'm using jboss rest easy client for accessing the rest API
    Here is a code for "Creating a folder"
    ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
    ResteasyProviderFactory.pushContext(javax.ws.rs.ext.Providers.class, factory);
    ResteasyClientBuilder resteasyClientBuilder = new ResteasyClientBuilder().providerFactory(factory);
    ResteasyClient client = resteasyClientBuilder.build();
    ResteasyWebTarget target = client.target(BASE_URL + "/getByPath('/TestFolder1')");
    Invocation.Builder request = target.request();
    request.header("Authorization", "Bearer " + this.token);
    Response response = request.put(Entity.text(""));
    And as per documentation, 401 UnAuthorized error means "Required authentication information is either missing or
    invalid."
    Am i missing any header that's supposed to be in the request/ Any other issue with the request?
    Thanks,
    Kathir

    Hi Kathir,
    Here's the official document about "X-RequestDigest":
    https://msdn.microsoft.com/en-us/library/jj164022(office.15).aspx#WritingData
    In addition, here's an example header information which works for me :
    Referer: https://xxxxxxxx.sharepoint.com/
    Accept: application/json;odata=verbose
    Accept-Language: en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh-Hans;q=0.3
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
    Host: xxxxxxxx.sharepoint.com
    Content-Length: 83
    X-RequestDigest: 0x4F26025E572CD220FBBAAD26654318A0B771CF72B09C0BFC45AFF8F1B2B301968040BC16377159210B4D7451BAD63BC93A406BF2357807E86BBD9BFF1EC5FB31,09 Apr 2015 13:31:50 -0000
    Cookie: FedAuth=77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48U1A+RmFsc2UsMGguZnxtZW1iZXJzaGlwfDEwMDM3ZmZlODU1NmRmYTJAbGl2ZS5jb20sMCMuZnxtZW1iZXJzaGlwfHJla2VubGl1QG8zNjVlM3cxNS5vbm1pY3Jvc29mdC5jb20sMTMwNzM0NjU5MzE5ODYyNTE2LEZhbHNlLGU5VkJQdk83UStLVDh4Z3poSEp3WWRwS2NUY1FuUlNFYjI3anpRMktIbzh0WWN0YVhNcEMzRjh3Z1hLeEJyQy9wSFBzR3NIeHViUnlqcEZTZFp6aFN4S0VFNmFaT3BBcGN3RUJWL2dyUXVHQ2VocmdQTmVFYUxXMGNxOWhYVnV5UXV5Qyt3MDg5MFVhKytnamZGVTNCZjRQT1lMV09QWGR1OG5FRCswUUdTdlZGTCtGdURHUisrMUltYUE2Nk5ITHh3TWpzTnN3UlFaN09VVytJb3RQNzhrV0hDcWZmbUt3TDZQVkRoMUJTdjd2amdraG9xaGRUTlVXNDFwWUpWZUVtdGE3SWk3WVAwalJSMkhteVNnclNEL0I0dnVQUzdheXRQNU5TaEVmSzg3UWl4Y2RUUm9jcE1XYkMvR2UrV2VmeDN1RHRJeWM3ZG4yNm80WVErYmkxdz09LGh0dHBzOi8vbzM2NWUzdzE1LnNoYXJlcG9pbnQuY29tLzwvU1A+; d7cc986c54074ba596c0f3f0c6a07e93c796165acdb446f0984f8653a924f5d0i%3A0%23%2Ef%7Cmembership%7Crekenliu%40o365e3w15%2Eonmicrosoft%2Ecom=0; SearchSession=3a9a1891%2D2085%2D4317%2Dae7d%2D358347ff5be6; WSS_FullScreenMode=false; d7cc986c54074ba596c0f3f0c6a07e93b4f54f20f4c04590a868420e78a3abbd=%3Ci%20p%3D%22d22c909f%2Dae4e%2D42e9%2D82ab%2Dbe906418413e%22%20m%3D%22lN63W5c9pPYyHWKxxdMl6WGWh6W6TASoSI78S9d1Uc0%3D%22%20%2F%3E; _InfoPath_Sentinel=1; _InfoPath_CanaryValueAGATTETXKDJ6KT4YXQ7Z6AULOUFCEL2MNFZXI4ZPJRXWGYLUNFXW44ZPJF2GK3JPORSW24DMMF2GKLTYONXCW3TQOVRU45KPMNKDI42KJJVU6TJYJ5UW65SWOB2EIVTMOZ3TEVTLOZYXOVSHPE2UK4BUJU=jkwaTNwRGHKjf96CdilK1qmjja8eMACiZvpNPbf6MqN+JaJ50wJVlC8//+5LQd5vHu1g5hM19pyNKgu7mkjxHw==|635641728335513421; rtFa=DbSfJe2tMA+9NtxyLWKWXkI6P5gUPQNGv+VYIvKXiLoX3B2zsHXjfIA5BgjT/aafd0uMETloZVbS+6Ks9Op+Epaiz9uAN3sCSpREr/K2URBpcO/8Io8CIv0SG8T0LpH+gTnEdL+Pa8cyGsqHuL1kUMjZoc7Qq07cqiwn1NO8bkyxK6HFXg+0bs7vqhTGAnZDYfUg2WG7WMWGk1QxxswZVQrnwBBInvGIIipzc7BJ9lu9XBmbfGDB+tgU78AsKS6BRDRdgSmPXq1ftMDTOACyzdHKrEUxJN5s2N6AOsujcDaFFyn8466SVD9zPxthkCDW+RDBJDIEinfW+UVPF8hmrz3gO/c3+OkH1pt65b3ydbcIQAWE9249X3nszh9KJSIzIAAAAA==
    I don't think it is related to a trial version. Please check whether you have missed the "User-Agent" header.  I suggest you first test it with JS in your environment.
    Thanks,
    Reken Liu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected].

  • 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

  • 401 Unauthorized Error when accessing a task from REST API which contains Role or Privilege in Access Control definition

    Hi Team,
    As of IDM 7.2 SP8 patch2, when we use Enterprise role or Privilege in the access control definition of a task, accessing this task from UI5 i.e REST API is giving unauthorized error even though user is already having the required role or privilege.
    But the task is working fine if we use fixed user ID or keeping blank value in allowed users field.
    Attached the current access control definition of the task we configured & the error message info for reference
    Regards,
    Venkata Bavirisetty

    Hi Ralitsa,
    Thanks for your response and sorry for late reply.
    The XXXX in role is not used as a wild card. the name itself is in that format. I have searched the role and then selected from search list.
    Let me know if you need any clarifications?
    Refards,
    Venkata Bavirisetty

  • REST API sync issue

    Hi expert,
      I created a Excel file into SharePoint 2013 Excel library and Post the URL into MS word quick parts of IncludePicture. in MS Word, I can get the Excel Chart. but when I update the chart and publish into SharePoint again, the word file does not change.
    does anybody knows how to sync both ?
    the URL like this,
    http://www.sharepointsite.com/_vti_bin/excelrest.aspx/Excel%20Library/TeamTasks_data.xlsx/model/
    charts('Task%20Status')?$format=image
    Thanks
    James Liang

    Hi,
    There’s a setting in your Trusted File Locations (in the configuration of the Excel Service Application) that you have to check, in order to have the REST API update the connections.
    http://www.sharepointblogs.be/blogs/vandest/archive/2014/02/20/excel-rest-api-not-refreshing-data.aspx
    If the issue still exists, please check whether you have select "Data not stored with document" in the "Field options".
    http://blogs.office.com/2009/11/09/excel-services-in-sharepoint-2010-rest-api-examples/
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Issue in invoking process order API from SOA

    Hi All,
    I am working on creating sales order in oracle Apps from Oracle SOA using Apps Adapter.
    I have used OE_ORDER_PUB.Process order API to create the sales order.I am also sending the org_id,reponsibility,username properties in Invoke activity.
    When I invoke the API ,I am getiing SQL Exception- invalid name pattern.
    The error payload is as follows.
    <fault>
    <bpelFault>
    <faultType>0</faultType>
    <bindingFault>
    <part name="summary">
    <summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'ESOA_SOprj' failed due to: Interaction processing error. Error while processing the execution of the APPS.XX_BPEL_ESOA_SOPRJ.OE_ORDER_PUB$PROCESS_ORDER API interaction. An error occurred while processing the interaction for invoking the APPS.XX_BPEL_ESOA_SOPRJ.OE_ORDER_PUB$PROCESS_ORDER API. *Cause: java.sql.SQLException: invalid name pattern: APPS.OE_ORDER_PUB_HEX54139X39X496 Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD.* This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "-17074" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary>
    </part>
    <part name="detail">
    <detail>invalid name pattern: APPS.OE_ORDER_PUB_HEX54139X39X496</detail>
    </part>
    <part name="code">
    <code>17074</code>
    </part>
    </bindingFault>
    </bpelFault>
    </fault>
    I also checked the oracle Apps database where there is no error in APPS.OE_ORDER_PUB_HEX54139X39X496 object.
    Kindly give your suggestions.
    regards,
    Goutam

    Did you get this to work?
    I checked the
    $INST_TOP/logs/ora/10.1.3/opmn/oafm_default_group_1/oafmstd.err file.
    Found the oracle.tip.adapter.db.sp.AbstractStoredProcedure execute was
    the next line was the
    <::Outbound><oracle.tip.adapter.db.sp.AbstractStoredProcedure execute> Bindings [P_ORG_ID=>NUMBER(null), P_OPERATING_UNIT=>VARCHAR2(null), P_API_VERSION_NUMBER=>NUMBER(1.0), ... long log details of the bind parameters....
    I search through to find the bindings which were P_HEADER_CUSTOMER_INFO_TBL=>APPS.OE_ORDER_PUB_CX54139X39X5692*(null)* but not allowable as null,
    then check the original SOAP request and added the blank parameter:
          <proc:P_HEADER_CUSTOMER_INFO_TBL></proc:P_HEADER_CUSTOMER_INFO_TBL>
    So then it didn't come through "NULL" and the procedure got properly called.
    Causing an error:
    <::Outbound><oracle.tip.adapter.db.exceptions.DBExceptionHandler isRetriable> SQLState is 65000 (unknown) for java.sql.SQLException: ORA-06531: Reference to uninitialized collection
    ORA-06512: at "APPS.ISG_OE_ORDER_PUB_PROCESS_ORDER", line 1
    ORA-06512: at "APPS.ISG_OE_ORDER_PUB_PROCESS_ORDER", line 1
    ORA-06512: at line 1
    That's a nasty call parameter list and very easy to miss a parameter when cleaning up the SOAP XML request.  That's how i did it.  Hope this helps the next guy.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Invoking a rest api from BPEL

    Has anybody tried to acess rest api from BPEL , if yes how?
    Has anybody have done integration with HBASE database

    Yes you can call Restful services from SOA 11g bu using HTTP binding that supports both GET and POST operation.
    See the blog below that explains it
    http://rajbpelblog.blogspot.com/2010/10/http-binding-in-soa11g.html

  • Error Using REST API to Retrieve SharePoint content

    I am developing a rather simple application that retrieves files from SharePoint using the REST Office 365 API. This is a batch job running in the background with no user interface so the following simple 2-step  flow is what I'm doing:
    (1) Requesting an Access Token from Azure AD (supplying client ID, client secret, resource, and grant_type=client_credentials) 
    (2) Invoke the SharePoint API (https://{base url}/_api/v1.0/Files) using the "Authorization: Bearer <access_token>" as a request header .
    That process seems pretty straightforward and sounds simple but I keep getting the following error :
    401 Unauthorized
    x-ms-diagnostics:  3001000;reason="There has been an error authenticating the request.";category="invalid_client"
    Any idea what the problem is and how this can be resolved ? I have been stuck on this for days now. I would REALLY appreciate somebody's help with this. Thanks.
    - CW

    Hi,
    According to the error message, the issue is related to Office 365 Rest API authentication.
    I suggest you can check the detailed web request using Fiddler to check the access token is valid in the request.
    Here are detailed articles for your reference:
    Files REST operations
    Remote authentication in SharePoint Online
    Fiddler
    Thanks
    Best Regards
    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]
    Jerry Guo
    TechNet Community Support

  • HTTP REST API call to CPSC 10.x from an external system

    Hi,
    I would like to know the below items.
    Is it possible to connect with the CPSC 10.x from an external system via HTTP REST API call to process a request and complete a task?
    Is it possible to create a new ticket / request in CPSC for a specific service via the HTTP REST API call?
    One of the use case is to know how many requests are pending in a queue via a HTTP REST API call? How to pass a queue name in the HTTP REST API call to get the result? These kind of custom piece is not available in the integration guide.
    Is there any specific REST API guide available which Cisco provides for the REST capability in CPSC?
    Any help is highly appreciated!
    Thanks.

    When a task is invoked from a service catalog request to an external system, the request remains open and the task is pending until the external system issues a call to complete the task.  The API for completing the task is SOAP-based.  Check out the Cisco Prime Service Catalog Integration Guide.  Within the doc, go to the section about "Web Service Listener Adapter" for the WSDL.
    You can order a service within Prime Service Catalog with a SOAP call, which is also documented in this same document.  Starting with Prime Service Catalog 10.1, you will have a way to order a service via a REST API.
    Existing REST APIs are also documented in the integration guide.

  • Sending attachments/binary data from flex to Restful APIs

    Hi,
    We have a requirement of sending the files (or binary data) from flex GUI to Restful services(backend APIs). We are using flex HTTPService component to invoke the rest apis. The Rest APIs are designed to accept the multipart/mixed data which can support the binary data as well.
    Can any one help us understand, how can we send the multipart/mixed OR multipart/form-data  from flex to backend using the HTTPService. Or is there a better way to send the mixed data from Flex GU to Restful APIs.
    Request you to please respond to this at the earliest as this is very urgent.
    Thanks and Regards,
    --Revanth

    Has anyone worked on this issue?? i wanted a quick response as we are in the middle of the development and this is a r
    equirement
    Thanks
    -Revanth

  • Invoking RESTful service from OSB

    Hi
    I need to invoke Restful service from OSB11g in order to do that...
    1. I have created Business service with the end point of the RESTful service.
    2. Running the Business service and provided the XML as input in Transport Header--> query-string.. i got the response as bellow:
    <serviceResponse returnCode="-1">
    <statusMessage messageId="Exception" messageType="" severityCode="E">
    <text>
    Required input not supplied. Please revisit your input values and try again.
    </text>
    </statusMessage>
    </serviceResponse>
    Is this the correct way i am doing or am i missing something..???
    Thanks
    Vasu

    Hi Vasu,
    did you solve your issue ?
    I have a similar scenario where I need to call a RESTful service from OSB.
    The RESTful URL service is http://xxx.xxx.xxx.xxx/api/ordertracer and has been implemented in IIS.
    The service accepts a xml string message as input and returns an HttpStatusCode.
    So I started defining a business service (named OrderTracer):
    Service Type: Any XML Service
    Endpoint URI: http://xxx.xxx.xxx.xxx/api/ordertracer
    HTTP Request Method:POST
    I tested it from business service test console:
    - in Transport
    -> query-string I put my input xml
    -> http-method: POST
    -> Content-Type: text/xml
    but on execute I got an error:
    <con:metadata xmlns:con="http://www.bea.com/wli/sb/test/config">
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <http:Connection>close</http:Connection>
    <http:Content-Length>315</http:Content-Length>
    <http:Content-Type>text/html; charset=us-ascii</http:Content-Type>
    <http:Date>Wed, 03 Oct 2012 15:07:38 GMT</http:Date>
    <http:Server>Microsoft-HTTPAPI/2.0</http:Server>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">3</tran:response-code>
    <tran:response-message xmlns:tran="http://www.bea.com/wli/sb/transports">Not Found</tran:response-message>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">us-ascii</tran:encoding>
    <http:http-response-code xmlns:http="http://www.bea.com/wli/sb/transports/http">404</http:http-response-code>
    </con:metadata>
    May I ask you to provide me any hints ?
    Thanks in advance for any help
    ferp

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

  • Error while accessing SharePoint 2013 news feed REST api - "The server encountered an error processing the request. See server logs for more details."

    Hi Experts,
    I am facing an issue while accessing SharePoint 2013 news feed REST api URL <SiteCollectionURL>/_api/social.feed/my/news from browser giving error "The server encountered an
    error processing the request. See server logs for more details."
    This is happening after posting the image to news feed without entering any text or description with that. If i post an image with some text or description, then i can able to get the feeds. Or else if i delete the image post then also i can able to get
    the feeds.
    I can able to see below logs in log files.
    Exception occured in scope Microsoft.Office.Server.Social.SPSocialRestFeed._SerializeToOData. Exception=System.MissingMethodException: No parameterless constructor defined for this object.     at System.RuntimeTypeHandle.CreateInstance(RuntimeType
    type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)     at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache,
    StackCrawlMark& stackMark)     at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)     at System.Activator.CreateInstance(Type type, Boolean nonPublic)
        at System.Activator.CreateInstance(Type type)     at Microsoft.SharePoint.C...
    ...lient.ValueTypeConverter.<GetODataProperties>d__2.MoveNext()     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteProperties(IEdmStructuredType owningType, IEnumerable`1 cachedProperties, Boolean isWritingCollection,
    Action beforePropertiesAction, Action afterPropertiesAction, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker, EpmValueCache epmValueCache, EpmSourcePathSegment epmSourcePathSegment, ProjectedPropertiesAnnotation projectedProperties)    
    at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteComplexValue(ODataComplexValue complexValue, IEdmTypeReference metadataTypeReference, Boolean isOpenPropertyType, Boolean isWritingCollection, Action beforeValueAction, Action afterValueAction,
    DuplicatePropertyNamesChecker duplicatePropertyNa...
    ...mesChecker, CollectionWithoutExpectedTypeValidator collectionValidator, EpmValueCache epmValueCache, EpmSourcePathSegment epmSourcePathSegment, ProjectedPropertiesAnnotation projectedProperties)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteProperty(ODataProperty
    property, IEdmStructuredType owningType, Boolean isTopLevel, Boolean isWritingCollection, Action beforePropertyAction, EpmValueCache epmValueCache, EpmSourcePathSegment epmParentSourcePathSegment, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker,
    ProjectedPropertiesAnnotation projectedProperties)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteProperties(IEdmStructuredType owningType, IEnumerable`1 cachedProperties, Boolean isWritingCollection, Action beforePropertie...
    ...sAction, Action afterPropertiesAction, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker, EpmValueCache epmValueCache, EpmSourcePathSegment epmSourcePathSegment, ProjectedPropertiesAnnotation projectedProperties)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteComplexValue(ODataComplexValue
    complexValue, IEdmTypeReference metadataTypeReference, Boolean isOpenPropertyType, Boolean isWritingCollection, Action beforeValueAction, Action afterValueAction, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker, CollectionWithoutExpectedTypeValidator
    collectionValidator, EpmValueCache epmValueCache, EpmSourcePathSegment epmSourcePathSegment, ProjectedPropertiesAnnotation projectedProperties)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSeriali...
    ...zer.WriteCollectionValue(ODataCollectionValue collectionValue, IEdmTypeReference propertyTypeReference, Boolean isOpenPropertyType, Boolean isWritingCollection)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteProperty(ODataProperty
    property, IEdmStructuredType owningType, Boolean isTopLevel, Boolean isWritingCollection, Action beforePropertyAction, EpmValueCache epmValueCache, EpmSourcePathSegment epmParentSourcePathSegment, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker,
    ProjectedPropertiesAnnotation projectedProperties)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteProperties(IEdmStructuredType owningType, IEnumerable`1 cachedProperties, Boolean isWritingCollection, Action beforePropertiesAction,
    Action afterPropertiesAct...
    Can anyone please help me out.
    Thanks!
    dinesh

    O365,
    Is this still an issue?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Getting error while uploading multiple files in sharepoint hosted app in 2013 with REST API

    Hi All,
    In one of my tasks, I was struck with one issue, that is "While uploading multiple files into custom list with REST API".
    Iam trying to upload multiple files in library with REST calls for an APP development, my issue is if i wants to upload 4 image at once its storing only
    3 image file and further giving "Conflict" error". Below is the attached screenshot of exact error.
    Error within screenshot are : status Code : 409
    status Text :conflict
    For this operation i am uploading different files as an attachment to an list item, below is the code used for uploading multiple files.
    my code is
    function PerformUpload(listName, fileName, listItem, fileData)
        var urlOfAttachment="";
       // var itemId = listItem.get_id();
        urlOfAttachment = appWebUrl + "/_api/web/lists/GetByTitle('" + listName + "')/items(" + listItem + ")/AttachmentFiles/add(FileName='" + fileName + "')"
        // use the request executor (cross domain library) to perform the upload
        var reqExecutor = new SP.RequestExecutor(appWebUrl);
        reqExecutor.executeAsync({
            url: urlOfAttachment,
            method: "POST",
            headers: {
                "Accept": "application/json; odata=verbose",
                "X-RequestDigest": digest              
            contentType: "application/json;odata=verbose",
            binaryStringRequestBody: true,
            body: fileData,
            success: function (x, y, z) {
                alert("Success!");
            error: function (x, y, z) {
                alert(z);

    Hi,
    THis is common issue if your file size exceeds 
     upload a document of size more than 1mb. worksss well for kb files.
    https://social.technet.microsoft.com/Forums/office/en-US/b888ac78-eb4e-4653-b69d-1917c84cc777/getting-error-while-uploading-multiple-files-in-sharepoint-hosted-app-in-2013-with-rest-api?forum=sharepointdevelopment
    or try the below method
    https://social.technet.microsoft.com/Forums/office/en-US/40b0cb04-1fbb-4639-96f3-a95fe3bdbd78/upload-files-using-rest-api-in-sharepoint-2013?forum=sharepointdevelopment
    Please remember to click 'Mark as Answer' on the answer if it helps you

Maybe you are looking for