RESTSponsored by Jamf Now

251

Solutions

505

Contributors

Representational state transfer (REST) is an architectural style that gives a coordinated set of constraints to the design of components in a distributed hypermedia system used to design networked applications. RESTful systems typically communicate over Hypertext Transfer Protocol (HTTP) with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) that web browsers use to retrieve web pages and to send data to remote servers. REST interfaces with external systems using resources identified by Uniform Resource Identifier (URI) that can be operated upon using standard verbs.

Share tech news, updates, or what's on your mind.

Sign up to Post

One of our clients has exchange 2010 and one user has a huge mailbox (currently about 65GB) so has to work in non-cached mode rather than cached mode.  His OST file just stopped working at 50GB. The user is complaining that searches are not returning all the results it should. Since he is using online mode, I assumed that all the indexing was being done by exchange server and rebuilt the index for the database he was using. (He and one other person share a whole exchange database, the rest of the company is on a different database.) He is still complaining that the search is not returning all the results. I know that when you are in cached mode, the email is indexed by Windows indexing, but what happens in non-cached mode?
0
Cloud Class® Course: Amazon Web Services - Basic
LVL 12
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

I got a requirement from the business that they want to use single user mailbox for 20 employee but they don't want to use shared mailbox.  now we are facing problem that only 6 outlook profile for the single mailbox are working at the same time and rest are not connecting. if we close any one of them than another outlook profile start working.Hence could anyone please let me know that how many outlook client can be connected for the single mailbox at the same time to the exchange server in exchange 2013 environment.
0
Hi All,

I'm developing an app that the user can see which of its contacts are registered for the app.
Say I have a data base of users in the cloud what should be the rest end point for such operation?
Should I send all of the user's contact to the endpoint and the server will make the set intersection between the input contact set the its all registered contacts?
But what if the user has many contacts?

Thank u in advance
0
I currently upload finish line pictures from races I time to Google + and share the gallery with race finishers so they can find their picture.  I would like to take that a step further and share each finishers individual picture with them.  I believe Google Vision has the technology to do that...albeit for a cost...by pairing participant bib number with bib in the image.  Is anyone familiar enough with this api to give me some direction as to how to do this?  Also, any idea how this product is priced?
0
Hi,

I have this json coming from an REST api. I now want to make a representaion of it in my asp.net site (I use vb.net for the moment). But I don't fully get it to work when I create the classes representing the json and deserialize it. This is how the json looks like when I copy it form Postman:
{
    "data": {
        "type": "vehicle",
        "attributes": {
            "regno": "HCA015",
            "vin": "WF0MXXGBWMDP17671"
        },
        "links": [
            {
                "rel": "self",
                "uri": "vehicle/vin/WF0MXXGBWMDP17671"
            },
            {
                "rel": "biluppgifter",
                "uri": "https://biluppgifter.se/fordon/HCA015"
            }
        ],
        "basic": {
            "data": {
                "make": "Ford",
                "model": "GALAXY 2.0 TDCi",
                "status": 2,
                "color": "Svart",
                "type": "PB",
                "vehicle_year": 2013,
                "model_year": 2013
            }
        },
        "inspection": {
            "data": {
                "latest_inspection": "2016-09-19T00:00:00+02:00",
                "inspection_valid_until": "2018-09-30T00:00:00+02:00",
                "meter": 38650,
                "next_inspection_range": [
                    "2018-05-01T00:00:00+02:00",
                    "2018-09-30T00:00:00+02:00"
                ]
            }
        },
        "status": {
            "data": {
                

Open in new window

0
I'm trying to use Rest assured and JsonPath to extract a value from the pzSetRuleSetFilter field where the pyRuleSetName equals a certain value (TradeMarks in this case). I keep getting the error below. Any ideas on how I can fix this and extract the value would be great

invalid JSON expression:Script1.groovy: 1: expecting EOF, found '[' @ line 1, column 39.

My Query System.out.println(response.jsonPath().getString("$..pxResults[?(@.pyRuleSetName == 'TradeMarks')].pzSetRuleSetFilter"));

See attachment for a screenshot of some of the Json response from SoapUI
Capture.PNG
0
I use FOS Rest Bundle with FOS user ton create registration form. The registration does not work so i tried to verify if there's an issue with my database.I've tried doctrine schema update and i receive a strange error .
[Doctrine\DBAL\Exception\DriverException]
  An exception occurred while executing 'CREATE TABLE `buyer` (id INT AUTO_INCREMENT NOT NULL, buyer_type_id INT DEFAULT NULL, country_id
   INT DEFAULT NULL, language_id INT DEFAULT NULL, first_market_region_id INT DEFAULT NULL, second_market_region_id INT DEFAULT NULL, thi
  rd_market_region_id INT DEFAULT NULL, creator_user_id INT DEFAULT NULL, modifier_user_id INT DEFAULT NULL, `name` VARCHAR(320) NOT NULL
  , `description` VARCHAR(1024) DEFAULT NULL, `main_products_services` VARCHAR(512) DEFAULT NULL, `reference_number` VARCHAR(100) DEFAULT
   NULL, `phone` VARCHAR(20) DEFAULT NULL, `fax` VARCHAR(20) DEFAULT NULL, `website` VARCHAR(100) DEFAULT NULL, `email` VARCHAR(255) DEFA
  ULT NULL, `first_name` VARCHAR(100) DEFAULT NULL, `last_name` VARCHAR(100) DEFAULT NULL, `job` VARCHAR(255) DEFAULT NULL, `picture` VAR
  CHAR(255) DEFAULT NULL, `address` VARCHAR(500) DEFAULT NULL, `zip_code` VARCHAR(10) DEFAULT NULL, `city` VARCHAR(10) DEFAULT NULL, `com
  pany_name` VARCHAR(320) DEFAULT NULL, `total_revenu` VARCHAR(100) DEFAULT NULL, `first_market_rate` INT DEFAULT NULL, `second_market_ra
  te` INT DEFAULT NULL, `third_market_rate` INT DEFAULT NULL, `is_public` TINYINT(1) NOT NULL, `views` INT DEFAULT NULL, …
0
windows 7 pro loads 31 processes and sits at black screen for 4 minutes to load the rest.

Only the cursor arrow shows. Partition reimaged with known good acronis tib and gets same result. GUI takes LOOOOONG time to load.
New Samsung 860 top 'o the line ssd appears okay/
0
Greetings,

I am using evaluation version of microstrategy, can you please let me know  how can I get table and columns of that table using REST API.
OR in generic term relation between objects.
0
In Powershell when I try to run Invoke-WebRequest -Uri http://DMS/admin/apps/478/0.0.2/Android -Method PUT -body $dms2

Invoke-WebRequest : Length Required
HTTP Error 411. The request must be chunked or have a content length.

my mission is to get some parameters in Invoke-WebReques Method Get , replace some variables and update specific line with Method PUT

my script:
$dms2=Invoke-WebRequest -Uri http://DMS/admin/apps/478/0.0.2/Android -Method Get
$dms2.Content.Split(',') | Select-String -Pattern "dictionary_url_rus"
$BB=$dms.tostring().Substring($dms.tostring().LastIndexOF("/") +1).trim('}','"')
$dms2.tostring() -replace $BB, "temp.json"

$dms=Invoke-WebRequest -Uri http://DMS/admin/apps/478/0.0.2/Android -Method PUT -body $dms2
0
Cloud Class® Course: CompTIA Healthcare IT Tech
LVL 12
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Hi guys,
when submitting data to a rest api via curl from php i sometimes get this error but very rarely- like 1 in a 100 times. Why would this be?

Data submitted with response <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>
0
Hi guys, i need to submit from my php code via curl to rest api. issue is they want me to submit with date and time stamp in following format: <DateSent>2018-04-26T15:12:36.9769394+02:00</DateSent>
I do have the format correct but i dont understand the part after the time "9769394" ? what could this be? doesnt look like mili seconds at all?
My date looks as follows when submiting : 2018-04-27T13:51:45+02:00 but server not accepting it
0
What is the best practice to log REST API response messages, these responses are too huge.
I am working on a requirement to log the responses to files
0
I have a rest api webservice which is going to return data in form of json doc. In my case it’s a object which I serialize via newtonsoft json. Works all fine but the json string I get in postman has all the escape slashes.  How can I get rid of those other then running a replace
0
I am trying to build a REST API in .NET and are running into some issues. My service will use JSON Data which is send to the Server in the Body.
I Created a Data Class like
Public Class ADDR_VAL_REQUEST
        Private HEAD As ADDR_VAL_HEADER
        Private BODY As ADDR_VAL_BODY
End Class[

 Public Class ADDR_VAL_BODY

        Private AFT As String = ""
        Private LD3 As String = ""
        Private LV3 As String = ""
        Private CITY As String = ""
... and so on

Open in new window


and here my basic sample for the post

      Public Function PostValue(<FromBody()> ByVal value As ADDR_VAL_REQUEST) As String
            If ModelState.IsValid Then
                Console.Write(value.BODY.CITY)

                Return "OK"
            Else

                Return "Error"
            End If

        End Function

Open in new window


Which fails, if i only post the body it works and i can parse the city just fine. So my question what do i need to do to be able to pass
more complex data like mine. It even fails if i send data like this

{		 "ADDR_VAL_BODY": {
			 "LV3": "",
			 "CITY": "NEW YORK"
		}
}

Open in new window

but works for
 {
			 "LV3": "",
			 "CITY": "NEW YORK"
		}

Open in new window


So here is my question, ow do you handle cases where the Data is more complex like in my case ? If the build in parsing does not work, how do i go about to access the posted body to get the json string and parse it via code myself ?
0
We cannot make a REST call using Classic ASP over TLS 1.2. This call is to get the authorization token from Paypal. We have tried lots of code variants with no success:

Example 1:
            Set xmlHttp = Server.CreateObject("WinHTTP.WinHTTPRequest.5.1")
            xmlHttp.Open "POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False
            xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xmlHttp.setRequestHeader "Accept", "application/json"
            xmlHttp.setRequestHeader "Accept-Language", "en_US"
            basico = "Basic " & Base64Encode(paypal_client_id & ":" & paypal_client_secret)
            xmlHttp.setRequestHeader "Authorization", basico <== "Invalid procedure call or argument"
            xmlHttp.Send "grant_type=client_credentials"

Example 2:
            Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP.6.0")
            xmlHttp.Open "POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False
            xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xmlHttp.setRequestHeader "Accept", "application/json"
            xmlHttp.setRequestHeader "Accept-Language", "en_US"
            basico = "Basic " & Base64Encode(paypal_client_id & ":" & paypal_client_secret)
            xmlHttp.setRequestHeader "Authorization", basico
            xmlHttp.Send "grant_type=client_credentials"  <== "An error occurred in the secure channel support"

Also, we've been able to make it with .NET and with PHP at the same server.
0
Want to post data on a rest api with given below code of vb6.  but fails.
 With Req
        .Open "POST", "http://202.166.207.75:9050/api/bill", async:=False
        .SetRequestHeader "Content-Type", "application/json; charset=utf-8"
        .SetRequestHeader "Accept", "application/json"
        Dim UNM As String
        Dim JSON As String
        JSON = Text13
        .Send JSON
       MsgBox CStr(.Status) & " " & .StatusText & vbNewLine _
                       & .GetAllResponseHeaders() & vbNewLine _
                       & String$(40, "-") & vbNewLine _
                       & .ResponseText
0
I'm currently using Roaster to generate a rest class, but i don't know how to implements http annotation (Get, Post,..) ?

Here's what I was trying to generate them with :

public class RestGenerator {
     public static void main(String[] args) {  

    JavaClassSource source = Roaster.create(JavaClassSource.class);
    source.setName("RestController").setPublic();
    source.addMethod().setName("Create").setPrivate().setBody("return null;")
    .addAnnotation();

    source.addMethod().setName("Delete").setPrivate().setBody("return null;")
    .addAnnotation();

    System.out.println(source);
}
}
output :

public class RestController
{

   @MISSING
   private void Create()
   {
      return null;
   }

   @MISSING
   private void Delete()
   {
      return null;
   }
0
Can I use the Telegram Bot API for listetning to message on a private invite-only channel?

Background information:
I was hired to do a gig for doing a Telegram bot that could parse messages and saved them into plain text. Now, I was told that the bot is required to listen to message in invite-only  channels. While doing some research, looks like this is a bit of an issue. I heard some suggest to use the Telegram Client API (instead of Bot), can someone confirm this is possible on the Bot API, or if I actually ave to switch towards Client?
0
Free Tool: SSL Checker
LVL 12
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Multi-part form data is not accepting in jersey API. When I am not setting the content header explicitly it is giving 'Unsupported Media Type' and when I am setting the header explicitly to multi part-form data it is giving CORS error.

Angular Calling :

 
  private headers1 = new Headers({'Content-Type' : 'multipart/form-data'});

      sendFile(fileObj: File){
       // alert(fileObj);
        return this._http.post(this.baseURL+'/submitexcel',fileObj,{headers : this.headers1}).map(res => res.json().data).subscribe();

        }

 }

Open in new window

JAVA API :
 @POST
               @Path("/submitexcel")
                @Consumes(MediaType.MULTIPART_FORM_DATA)
                public Response uploadFile(

                        @FormDataParam("file") InputStream uploadedInputStream,
                        @FormDataParam("file") FormDataContentDisposition fileDetail) {
                    // check if all form parameters are provided
                   System.out.println("CAssked");
                    if (uploadedInputStream == null || fileDetail == null)
                        return Response.status(400).entity("Invalid form data").build();
                    // create our destination folder, if it not exists
                    try {
                        createFolderIfNotExists(UPLOAD_FOLDER);
                    } catch (SecurityException se) {
                        System.out.println("Can not create destination folder on server");
          

Open in new window

0
I have an existing Visual Studio 2013 ASP.NET MVC web service app that works fine on Dev Server A.  I can launch and debug the web service and everything works properly.

I am setting up the project on a new server, Dev Server B, trying to match the configuration of Server A.  The Visual Studio code has not been changed.  I have the code working and debugging on Dev Server B, but one of the controller methods is not working for some reason.  The other controller methods work fine.

If I access the URL on Dev Server B:

http://localhost:1881/DynamicsIntegration/CheckStatus2

I get this error: The resource cannot be found HTTP 404

Resource cannot be found

Strangely, if I rename the method name in the controller to anything else, it works fine.  CheckStatus1, CheckStatusA, etc. work fine.  But "CheckStatus2" does not work.

CheckStatus2
When this error occurs, no breakpoints are hit in the CheckStatus2 code, and no breakpoints in the controller are not hit.  When I rename the method, it works fine.

I don't think I have any routing setup, and haven't been able to find anything that may be causing "CheckStatus2" to be an invalid route.  My assumption is that something is getting cached in IIS or some routing hint is causing the problem, but I can't find any clues.

How can I troubleshoot this or track down the problem?
0
The scenario is that I have a PHP function which makes call through third party library to a third party url and it is noticed that it gets timeout due to heavy traffic.

I have put a Circuit is open check condition in my try block and in catch block I have added code to raise exception in circuit breaker library i.e. whenever I get Connection timeouts Exception from third party library I raise a PHP exception in circuit breaker command by passing a boolean flag.

The issue I am getting is that short circuits happens at requests early than the threshold.

With below configurations only for this command

'circuitBreaker' => array(
   'errorThresholdPercentage' => 50,
   'requestVolumeThreshold' => 10,
   'sleepWindowInMilliseconds' => 10000,
   'rollingStatisticalWindowInMilliseconds' => 20000,
)
0
Hey guys,

I am working with SAP and excel on daily basis. Part of the job is copy paste data frome excel to sap.

I've created macro that helps me to do that. The problem is macro copying pasting data only cel by cell.

I need to copy paste by 25 cells.

Any suggestions how can adjust my script so I can copy every 25 values and paste them?
Script is attached

If Not IsObject(application) Then
   Set SapGuiAuto  = GetObject("SAPGUI")
   Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
   Set connection = application.Children(0)
End If
If Not IsObject(session) Then
   Set session    = connection.Children(0)
End If
If IsObject(WScript) Then
   WScript.ConnectObject session,     "on"
   WScript.ConnectObject application, "on"
End If
 
Set xclapp = CreateObject("Excel.Application")
Set xclwbk = xclapp.Workbooks.Open("C:\.....\test.xlsm")
set xclsht = xclwbk.Sheets("Sheet1")
 
for i = 2 to xclapp.ActiveCell.SpecialCells(11).Row
 for j = 1 to xclapp.ActiveCell.SpecialCells(11).Column
  if j=1 then SKU =  xclsht.Cells(i,j).Value

 next

session.findById("wnd[0]").resizeWorkingPane 254,39,false
session.findById("wnd[0]/usr/tblSAPMV13GTCTRL_FAST_ENTRY/ctxtKOMGG-PMATN[0,0]").text = SKU
session.findById("wnd[0]/usr/tblSAPMV13GTCTRL_FAST_ENTRY/ctxtKOMGG-PMATN[0,0]").setFocus
session.findById("wnd[0]/usr/tblSAPMV13GTCTRL_FAST_ENTRY/ctxtKOMGG-PMATN[0,0]").caretPosition = 0
0
I´m trying to define a standard for my API. Every resource I have right now, comes from a SQL Server Database. And most of them, are tables with a composite primary key.
Every resource has a `href` property pointing to itself, but i also need to complete an `id` property to be able to identify it.
As they have composite keys, I thougth of setting the `id` property with the json value of the key object, for example:

Lets say just a silly example just to be more clear of a city resource:

City Table: `countryId`, `provinceId`, `zipcode`, `name`. PK = `countryId`, `provinceId`, `zipcode`

City Resource:

    {  
       "href":"some link over here..",
       "id":[  
          1,
          3,
          "2456ZC"
       ],
       "countryId":1,
       "provinceId":3,
       "zipCode":"2456ZC",
       "name":"Some City Name"
    }

Open in new window


Then, when I get in the server this resource, I can use the id object to get the entity of the database by key.
Because the json Id property is pretty complex, I thought of serializing it in the server to json:
[1,3,"2456ZC"]

Open in new window


And encode it with base64 url safe giving this result:
WzEsMywiMjQ1NlpDIl0%3D

Open in new window


Final result:

    {  
       "href":"https://api.com/cities/WzEsMywiMjQ1NlpDIl0%3D",
       "id":"WzEsMywiMjQ1NlpDIl0%3D",
       "countryId":1,
       "provinceId":3,
       "zipCode":"2456ZC",
       "name":"Some City Name"
    }

Open in new window


Is there any drawbacks of this solution? I know that if I add or remove one field of the primary key fields in the table the Id would change, but this would not happen.
0
I need to integrate Apple Pays decrypted Payment Token Format into a Stripe Rest API call. This does not require any Stripe SDK's or JS files. The raw apple pay token information has already been decrypted ready for stripe to process via 'Source', 'Token', 'Charge' etc. Stripe support will not disclose the solution but acknowledge its possible, why, i am not sure? Spreedly does exactly as i am describing with Stripe, passing in the information below, but how is it correctly structured?

This is the what a decrypted Apple Pay payment token format looks like:

{"applicationPrimaryAccountNumber":"4xxxxxxxxxxxxxxx","applicationExpirationDate":"211130","currencyCode":"840","transactionAmount":1000,"deviceManufacturerIdentifier":"000000000000","paymentDataType":"3DSecure","paymentData":{"onlinePaymentCryptogram":"/random+stuff=","eciIndicator":"7"}}
payment-token-reference.jpg
0

RESTSponsored by Jamf Now

251

Solutions

505

Contributors

Representational state transfer (REST) is an architectural style that gives a coordinated set of constraints to the design of components in a distributed hypermedia system used to design networked applications. RESTful systems typically communicate over Hypertext Transfer Protocol (HTTP) with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) that web browsers use to retrieve web pages and to send data to remote servers. REST interfaces with external systems using resources identified by Uniform Resource Identifier (URI) that can be operated upon using standard verbs.

Top Experts In
REST
<
Monthly
>