Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x

REST

185

Solutions

380

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

Hi

I am trying to find an example of building a web project in Visual Studio that manipulates the REST/SOAP API
as per https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm

I am an ASP.net developer and was hoping to use an ASP.net web app
0
Tech or Treat!
LVL 10
Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

I'm extremely new to programming. I've been tinkering with it on and off for decades but have never written an actual program. That changed yesterday.

Now, I've hit a brick wall.

I do not understand the fundamentals, but I get how code works for the most part.

My question is I have code that looks like this:

Private Sub Crystl32Button_Click(ByVal sender As System.Object, e As EventArgs) Handles Crystl32Button.Click
        For Each P As Process In System.Diagnostics.Process.GetProcessesByName("InHouseApp")
            P.Kill()
            P.WaitForExit()
        Next
        My.Computer.FileSystem.CopyFile("\\remoteserver\software\iha\ocx\crystl32\*.*", "C:\Windows\System32\",
        Microsoft.VisualBasic.FileIO.UIOption.AllDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
    End Sub

Open in new window


I want to add the functionality of this:

Sub RemoveFileSecurity(ByVal fileName As String, ByVal account As String, _
        ByVal rights As FileSystemRights, ByVal controlType As AccessControlType)

        ' Get a FileSecurity object that represents the 
        ' current security settings.
        Dim fSecurity As FileSecurity = File.GetAccessControl(fileName)

        ' Remove the FileSystemAccessRule from the security settings. 
        fSecurity.RemoveAccessRule(New FileSystemAccessRule(account, _
            rights, controlType))

        ' Set the new access settings.
        File.SetAccessControl(fileName, fSecurity)

    End Sub

Open in new window


This code is supposed to remove the ACL listing of a specific account for a file.

However, I do not know how to add this:

Sub RemoveFileSecurity(ByVal fileName As String, ByVal account As String, _
        ByVal rights As FileSystemRights, ByVal controlType As AccessControlType)

Open in new window


To my button click sub. Whenever I try, it auto-completes and removes the "Sub" I type in. I assume you can't have a Sub within a Sub but what do I modify in order to get the rest of the ACL code to work with the button click? Do I have to modify the button click Sub in order to match the ACL one?

I apologize if I'm not making sense. Again, this is my first real program and I'm not exactly up to par on all the methodologies.
0
I am hitting a wall here and exhausted my researching skills. Looking to the experts here.
In summary, my developer at work created a REST API for me to call via Access/VBA. Below is some sample code I have created to use this API. This API is to call an import utility to import the data I am passing in the request.

I know my authentication is good as well as the URL. I am getting a http status of 200 and a expected JSON response. Also in the API I am passing the ImportSpecification ID that has to exist in the source system. If I change that value to "XYZ" I get an error saying the Import Specification doesn't exist. So that validates the URL in my opinion.

Based on the JSON response, it doesn't appear the body (response) of my message is getting received. Below is my code for reference. I have taken out the necessary sensitive info. What am I missing here?!?!

Dim sURL As String, Request As String
Dim xmlhtp As XMLHTTP60
Set xmlhtp = New XMLHTTP60

Request = "<ImportData xmlns=""urn:Import.DataUtility"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">"
Request = Request & "<Data xsi:nil=""false"">"
Request = Request & "<string xsi:nil=""false"" xmlns=""http://schemas.microsoft.com/2003/10/Serialization/Arrays"">##INI=EMP</string>"
Request = Request & "<string xsi:nil=""false"" xmlns=""http://schemas.microsoft.com/2003/10/Serialization/Arrays"">1,DATLATEST</string>"
Request = Request & "<string xsi:nil=""false"" …
0
Hello,
I have written a mock for a REST service using SoapUI free version. The resource path looks like <webservice>/employees which returns all employees in JSON. Now I want to pass a parameter which is a date range, something like <webservice>/employees?from=01-01-2017&to=31-12-2017
This will return only a few employees who joined during the date range. I am not able to find a way to accept parameters in the mock response and not sure how do i check something like if(date == 01-01-2017 to 01-04-2017) { //pass this json text   } else if(date == 08/08/2017 to 31/12/2017) { pass this text }

Any help would be greatly appreciated as I am new to SoapUI
0
I am currently hosting an API as an Azure App service. But I want to move it into my Virtual Machine and run it in IIS.
I already set it up as I would with any website but for some reason the page does not come up. Is there anything in specific I need to do to run the service?
0
So we're a Canadian company, and we had our Exchange 2010 on prem for a long time. An American company bought us out, and we ended up migrating our mailboxes to their newer Exchange 2016. However, we all notice the lag now, and although it's tolerable for some of us who are at major offices with Fiber internet connections, the rest of us are having a myriad of problems with the new setup, everything from inconsistent lag, to DNS and Autodiscover setup being less than ideal, to local Mailbox caches continuously break and forcing to recreate profiles in Outlook every time someone jumps on and off the VPN.

I wanted to explore the option of getting Exchange Online or some other service, and migrating those mailboxes to the Cloud, and having those users connect to the cloud-based mailbox. It makes even more sense to leverage cloud as the people who have these problems the most are mobile and are travelling across North America all the time.

Has anyone had experiences or a setup like this, and if so, can you give any feedback or advice on how to approach it?


Thanks
0
MS Access 2013 - I have a shared database with a form that maximizes on open.  It has an EXIT button with an event property of docmd.quit.  On my computer the EXIT button closes completely out of Access which is what I want; however for all other users, when they click the EXIT button, it only closes the form and leaves the rest of Access open.   I would appreciate any assistance please.
0
Someone has suggested that I do a client side only rest api implementation using Angular or another MV* frontend framework. However, it is my understanding that client side only is not safe to have sensitive information flowing back and forth to API, like the API KEY.

Is there an external source known to someone here that could be used to fetching credentials and enforcing CORS - cross-origin resource sharing?

Any tips or best practices or advice on this ask would be appreciated.
0
This plugin appears on a site I created as needing updating. I don't recall ever adding it.  Does anyone know what it is for and should I update it?
0
Hi,
I am testing the deployment of BITLOCKER via GPO.
For the moment I want to just encrypt the fixed drives without using TPM
I have created a TEST OU and moved a single computer to it.
I have created a GPO and edited/activated the following
Computer Configuration>Administrative Templates>Windows Components>BITLOCKER encryption
I have activated the following
Control the use of BITLOCKER on fixed drives:ACTIVE
Configure the encryption on the hardware level on the fixed drives:ACTIVE
Select the recovery method for recovery of fixed drives using BITLOCKER: ACTIVE
The rest is not configured.
Please note that I have the GUI in french so the translation might not be exact.

I have applied the GPO to the TEST OU
run gpupdate /force on the only computed within the OU
Restarted the computer
The GPO does not seem to apply
manage-bde -status and the bitlocker mmc show the the bitlocker DISACTIVE

What am I doing wrong or what do i need to add?
Please help.
Lenovo ThinkPad with running Windows 10

Are there any compatibilty issues with OPAL drives?


GPO Bitlocker
0
Free Tool: Port Scanner
LVL 10
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

I'm looking to consume an external Rest API Json data source into a SharePoint Online list column. I have the enterprise version with BCS.  Anyone had luck with this?
0
I am trying to do something similar to the app specs below.  I'm looking for a sample.  I thought I would use Asp.net Core MVC,  Ajax and SQL server.  I'm looking for a sample that can show me each step.

It's pretty simple.
1. My app has a form with 4 fields. (Vin, Make, Model, Year)
2. I input Vin in field 1 (Vin)
3. I GET from a third party Rest API JSON by passing the Vin to a URI string. The string will pass Vin I input and an API key
4. The API returns (Make, Model, Year)
5. I want to fill the additional form fields with (Make, Model, Year)
6. Finally, I want to save all fields (Vin, Make, Model, Year), to my Database.

I have been searching for an example similar.  I did find the Weather app example, but it's not complete.  It's just part of it.
Weather example: https://www.codeproject.com/Articles/1180283/How-to-Implement-OpenWeatherMap-API-in-ASP-NET-MVC
0
I want to build a web app that has a lookup field on my form to get data from a 3rd party Restful api.  It would make a url call to the service like : http://www.something.com/api/?id=12345. It passes 1 value.  That call would return 4 values.  Those values would populate my 4 form fields.  Upon save, I would save that data to my database. I planned to use c# and javascript and a MSQL or MySQL db.   I'm open though since it's from scratch.  I'm looking for maybe a HTML, Javascript, DB example or HTML, Javascript, DB, C# or PHP example.  Does anyone have an example of how to do that?
0
how may possible ways are there to authenticate REST API requests.
please provide few examples
0
I need a web service to remain secret and would use CloudFare or a similar technology to prevent DDoS attacks. Aside from DDoS, what other types of attacks are possible?

I assume my web service domain would be totally hidden, but need to be sure there is no other known threat to it.

Thanks
0
I love the notion that my REST web service could deliver a complete UI to the client, which that the client could then display complete functionality inside a window, on their own site. What's kind of client/server relationship is this?

Is this what Code-On-Demand does?

Does it return HTML/JavaScript/CSS?

What kind of control is needed on the client to receive this? An iframe?

What kind of problems might there be with this kind of interaction?
0
Thank you for looking at my question,

I want to emulate a little bit of functionality that is a feature of this site. When the user allows the pointer to rest on a question title a little information box is displayed containing the question title text.

I have a couple of text input fields on an internal web page that will be populated by scanning a data matrix / QR code. The first element from the QR code will be displayed in the text box and other elements written to hidden fields.

When the user mouseover's(?) the text box I would like to display the associated information in a small box that closes on the mouseout event. How do I create the information box please?
0
Hi All :)

my issue is most of the updates i try to install on the file server fails with [reverting back changes], i tried so many things with the server: clean boot - system file checker - chkdsk - restoring the image health using DISM from a WIM file - renaming the software distribution folder

i also tried to install the updates in the below link one by one in order from bottom to up with a restart in every installation but the server got the first 3 updates only (KB3172615 - KB3179575 - KB3185280), the rest failed with the message [reverting back changes]
https://support.microsoft.com/en-us/help/4009471/windows-server-2012-update-history

i hope someone can help me ASAP please, here is the log of my last installation attempt...

2017-08-12      10:38:17:896       540      1104      Misc      ===========  Logging initialized (build: 7.8.9200.16924, tz: +0200)  ===========
2017-08-12      10:38:17:896       540      1104      Misc        = Process: C:\Windows\system32\svchost.exe
2017-08-12      10:38:17:896       540      1104      Misc        = Module: c:\windows\system32\wuaueng.dll
2017-08-12      10:38:17:896       540      1104      Service      *************
2017-08-12      10:38:17:896       540      1104      Service      ** START **  Service: Service startup
2017-08-12      10:38:17:896       540      1104      Service      *********
2017-08-12      10:38:17:912       540      1104      Agent        * WU client version 7.8.9200.16924
2017-08-12      10:38:17:912       540      1104      Agent        * Base directory: C:\Windows\SoftwareDistribution
2017-08-12      10:38:17:912       540      1104      Agent        * Access type: No proxy
2017-08-12      …
0
Hello fellas,

This is my first question and I really require assistance on this case I'm working on.

My friend's PC has an 1TB Samsung Hard Drive that was partitioned to three pieces, but last week suddenly it shows on Windows Explorer and Disk Management the System Reserved drive, with only 150GB. (please see attachment capture).

System Information:
OS: Windows 8.1 Pro
Version: 6.3.9600 Build 9600
Processor: Intel(R) Core (TM) i7 CPU
Dell Inc. x64 based PC
BIOS version date: DELL INC., A15, 2/4/2010.

I checked on Event Viewer and it showed on August 13th, 2017 that the Volume D: has been repaired. This event showed up 13 times or more in a row between seconds. (warning event)

Then it brought up the error event on the same day, which said A corruption was discovered in the file system structure on volume D:

The Master File Table (MFT) contains a corrupted file record.  The file reference number is 0x1000000000018.  The name of the file is "<unable to determine file name>".

//
Now knowing these, I checked for viruses and unwanted programs, from the basics of course. Then I was checking the partitions but my main concern is the fact that the remaining space, the other hidden disk drive have no weight on it whatsoever, just an empty letter assigned to each one of them, which is why I can't make recovery.

I tried looking the data of these partitions (important) with DISKPART but no help, I installed the Mini Tool Partition Wizard to see if I could …
0
Concerto's Cloud Advisory Services
LVL 4
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Hello,

I am trying to access an endpoint with API using Basic authentication (Username and password).  I tried two methods that did not work for me.

Method 1:

var apiTest = new XMLHttpRequest();
var username ='testUser';
var password ='letUserIn1#';
apiTest.open('GET', 'https://internal.com/agency');
apiTest.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + password));
apiTest.setRequestHeader('Accept', 'application/json');

apiTest.onload = function() {
                var apiData = JSON.parse(apiTest.responseText);
                console.log(apiData[0]);
};

apiTest.send();

Open in new window

I get the following error for method 1 in Chrome:
chromeErrorI get this in IE
IE Error
Method 2:
$.ajax({
    url: 'https://internal.com/agency',
    method: 'GET',
    crossDomain: true,
    beforeSend: function ( xhr ) {
        xhr.setRequestHeader( 'Authorization', 'Basic ' + Base64.encode( 'testUser:letUserIn1#') );
    },
    success: function( data, txtStatus, xhr ) {
        console.log( data );
        console.log( xhr.status );
    }
});

Open in new window

Here's the error I get:
errorI get the same error in IE.  Base64 is undefined.

Any help would be much appreciated.

Thanks!
0
Hi Friends,

according to my work,I have number of pdf files present in one folder .I need to merge all the files into a single pdf  file  based on last modified time stamp. Means first modified pdf file as first and then the rest.
I tried with the below code.

Sub Main() 
     
    Const DestFile As String = "MergedFile.pdf" ' <-- change to suit
     
    Dim MyPath As String, MyFiles As String 
    Dim a() As String, i As Long, f As String 
     
     ' Choose the folder or just replace that part by: MyPath = Range("E3")
    With Application.FileDialog(msoFileDialogFolderPicker) 
         '.InitialFileName = "C:\Temp\"
        .AllowMultiSelect = False 
        If .Show = False Then Exit Sub 
        MyPath = .SelectedItems(1) 
        DoEvents 
    End With 
     
     ' Populate the array a() by PDF file names
    If Right(MyPath, 1) <> "\" Then MyPath = MyPath & "\" 
    ReDim a(1 To 2 ^ 14) 
    f = Dir(MyPath & "*.pdf") 
    While Len(f) 
        If StrComp(f, DestFile, vbTextCompare) Then 
            i = i + 1 
            a(i) = f 
        End If 
        f = Dir() 
    Wend 
     
     ' Merge PDFs
    If i Then 
        ReDim Preserve a(1 To i) 
        MyFiles = Join(a, ",") 
        Application.StatusBar = "Merging, please wait ..." 
        Call MergePDFs(MyPath, MyFiles, DestFile) 
        Application.StatusBar = False 
    Else 
        MsgBox "No PDF files found in" & vbLf & MyPath, vbExclamation, "Canceled" 
    End If 
     
End Sub 
 
Sub 

Open in new window

0
i am new to rest api.
i want to implement REST API for my project which is developed with Spring framework.
i want to implement  REST API in best way.

Please provide sugggistions for design and development.
0
Here is the code

Function EIGEN_JK(ByRef M As Variant) As Variant

'***************************************************************************
'**  Function computes the eigenvalues and eigenvectors for a real        **
'**  symmetric positive definite matrix using the "JK Method".  The       **
'**  first column of the return matrix contains the eigenvalues and       **
'**  the rest of the p+1 columns contain the eigenvectors.                **
'**  See:                                                                 **
'**  KAISER,H.F. (1972) "THE JK METHOD: A PROCEDURE FOR FINDING THE       **
'**  EIGENVALUES OF A REAL SYMMETRIC MATRIX", The Computer Journal,       **
'**  VOL.15, 271-273.                                                     **
'***************************************************************************

Dim A() As Variant, Ematrix() As Double
Dim i As Long, j As Long, k As Long, iter As Long, p As Long
Dim den As Double, hold As Double, Sin_ As Double, num As Double
Dim Sin2 As Double, Cos2 As Double, Cos_ As Double, Test As Double
Dim Tan2 As Double, Cot2 As Double, tmp As Double
Const eps As Double = 1E-16
   
    On Error GoTo EndProc
   
    A = M
    p = UBound(A, 1)
    ReDim Ematrix(1 To p, 1 To p + 1)
   
    For iter = 1 To 15
       
        'Orthogonalize pairs of columns in upper off diag
        For j = 1 To p - 1
            For k = j + 1 To p
               
                den = 0#
               …
0
I have a REST call using jQuery Ajax and it works fine on every browser except for IE11.  When I make this POST call,  I get back a 400 error and the data doesn't get written.

Any advise on this would be greatly appreciated.
0
I am writing a REST client application using Embarcadero C++ builder Xe10.1 Berlin.
I need to have the REST server IP address configurable.
I have initially set the TRESTClient component BaseURL property to a known server IP address in the IDE. The BaseURL property value is http://10.41.9.27:8080 and the application works just fine.
If I add code to change the BaseURL property however, the application doesn't respond and times out ?
Even if I use the value that works when set in the IDE, after the following code is run the application stops working ?

RESTClient1->BaseURL = u"http://10.41.9.27:8080";

Open in new window


Any ideas please ?
0

REST

185

Solutions

380

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.