REST

312

Solutions

608

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 have this rest api request that returns a boolean value. Initially this value is always set to false but will turn to true within seconds (or up to a minute) . I need to do re-do or poll the request until the status of the value has changed from false to true and then, of course, stop the request(s) and continue.

What kind of methods can I use to make this happen.

Grateful for help and example code.

Peter
0
Microsoft Azure 2017
LVL 13
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

I am very new to Rest API. Does anyone know how to create a script that will allow me to create an array of servers called host and delete all services attached to the host. In Nagios XI example cURL request to remove service is:

curl -XDELETE "https://nagiosservername/nagiosxi/api/v1/config/service?apikey=JNKelhL55D47u6GvniX7Y8oOlaQQ2V2LI3YjjZnoCKun6qVsLSS0gAOUJUK2P23N&pretty=1&host_name=testapihost&service_description=PING&applyconfig=1"

What I need to do is delete 700 servers from my Nagios XI install. In order to do that I need to first delete all that is configured for each host including all the services and host groups.
0
I want to develop a RESTful web service in java which accepts payment transactions, debit and credit both. Assume, thousands of transaction requests are expected every second and response should be sent back immediately. This means, my web service should be asynchronous. I want it RESTful and I will be using spring boot for developing it. Can anyone suggest the best design to make it asynchronous so that transaction requests are accepted immediately as they come and payments are processed concurrently? Payment processing could be a complex process which may involve further interacting with many systems and databases. But I am more worried about the entry point. Customers should able to send transaction requests swiftly without any blocking. They could be using an Android or iOS app to do this activity. Thanks.
0
Experts,
 We have sharepoint 2013 environment. We have one custom Access Denied page where i added javascript code to check current user is part of group or not. I am getting userid from"_spPageContextInfo.userId" and use below rest api code to access username.

var ctx = new SP.ClientContext.get_current();
        this.web = ctx.get_web();
        this.currentUser = this.web.get_currentUser();
alert(currentUser);
var userid= _spPageContextInfo.userId;
var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")";
var requestHeaders = { "accept" : "application/json;odata=verbose" };
$.ajax({
    url : requestUri,
    contentType : "application/json;odata=verbose",
    headers : requestHeaders,
    success : onSuccess,
    error : onError
});

Open in new window


Now when user does not have permission for that page and access then it's read the user id but it's authenticate fail for rest api.  Below is the error message.

 HTTP401: DENIED - The requested resource requires user authentication.
(XHR)GET - http://server/_api/web/getuserbyid(47)

How to resolve this problem? I want to read current username from that page. Is there any way that rest api will not fail?
0
Hi Experts,

Can you please share me the solution in C# to upload the document and file information to another system by using the restful request .

I have following :

1) Url ( They provided the service url to upload the documents)

Regards,
Kumar
IMG-20190220-WA0051.jpg
0
Hi Experts,

I need to help on writing the C# code develop a following solution.

Basically my requirement is to export the files to another application through restful web-service call (POST).

They provided following  :
URL ( Insert document service )
its restful web service call  - POST

They are expecting the request  multipart/Mixed  with json structure.

Please let me know if any questions.

Regards,
Kumar
1
I have a service which has a REST endpoint which returns a simple LIST containing Events and the event descriptions. I have been asked to return the output in standard JSON format. Is this just a matter of adding , RequestFormat = WebMessageFormat.Json &    ResponseFormat = WebMessageFormat.Json to the operation contract or is there more to it than this ?
0
I'm trying to set up an SSL endpoint on my server (Windows Server 2012 R2) so that it can receive https POSTs from an external server. I am using a simple REST framework for Powershell called RestPS: https://github.com/jpsider/RestPS to listen on port 8089 and I have an SSL certificate that I'm trying to use but I am getting errors when I try to use it. I'm very much a novice with SSL certificates and need some help. When I run Start-RestPSListener in Powershell, I get these messages:

SSL Certificate deletion failed, Error: 2
The system cannot find the file specified.

SSL Certificate add failed, Error: 1312
A specified logon session does not exist. It may already have been terminated.

Starting: https:// Listener on Port: 8089

Open in new window


I'm not sure what those errors mean or if they matter. But something isn't right because when I try to POST from the external server I get an 'unknown SSL protocol error' connecting to my server.

I've looked at the certificate stores using the MMC and there's a bunch of stuff in there, but it's all very confusing to me.

Not sure if this is related: I'm also running Apache on this server, and it is listening on port 443 using the same SSL certificate. It is working fine and receiving POSTs.

Also, here's what I'm getting from the external/remote server trying to POST to my server:

 Trying <<ip address>>...
Name '0.0.0.0' family 2 resolved to '0.0.0.0' family 2
Local port: 0
Connected to <<domain name>> (<<ip 

Open in new window

0
Hi,
 We have sharepoint list view where user filter and sort data. Now we would like get sorting and filter parameters and generate rest api url by script editor to fetch some list items. is it possible to read filter and sorting parameter by url or ctx object?

There is a object ctx.ListData.Filterlink gives some parameters but it's in another format.

"?FilterField1=LinkTitle&FilterValue1=A&SortField=LinkTitle&SortDir=Asc&PageView=Shared&"

Here is the REST Api url where i need to add filter and sorting parameters.
 url: siteUrl + "/_api/lists/getbytitle('Test_Custom_List')/Items?$select Title",



 <script>
var siteUrl = window.location.protocol + "//" + window.location.host + _spPageContextInfo.siteServerRelativeUrl;
 
jQuery.ajax({
  // need to generate dynamic url based on filter and soting on page
    url: siteUrl + "/_api/lists/getbytitle('Test_Custom_List')/Items?$select Title",
    type: "GET",    
    headers: { 
        "accept": "application/json;odata=verbose",
        "content-type":"application/json;odata=verbose",
        "X-RequestDigest": jQuery("#__REQUESTDIGEST").val()
    },
    success: function(d) {
        var stringData = JSON.stringify(d);
        var jsonObject = JSON.parse(stringData);
        var results = jsonObject.d.results;
        for(i = 0; i < results.length;i++) {
            console.log(results[i]["Title"])
        }
    },
    error: function() {
        console.log('fail');
    }
});
</script>

Open in new window

0
Please reference the solution to my previous question:

PowerShell:  Move from using arrays/looping into objects/pipelining

This has been working on the inital data sets but these were quite small.  Now that the QA team is actually loading devices, the script fails to write the results to the file.  Here is the current code:
# Get all mobile devices from JAMF
$JAMFfile = $FilePath + "\JAMF_Prod.csv"

$BaseURL = "https://" + $JAMFAPIServer + "/JSSResource/mobiledevices"
$Header = @{"Authorization" = "Basic "+[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($JAMFAPIUser+":"+$JAMFAPIPassword))}
$Type = "application/json;charset=UTF-8"


Try 
{

    $MobileDeviceResponse = Invoke-Restmethod -Uri $BaseURL -Method GET -ContentType $Type -Headers $Header
    $MobileDeviceResponse.mobile_devices.mobile_device |
        Select-Object -Property name, 
                         id,
                         serial_number,
                         model,
                         @{n="department";e={ 
                                (Invoke-Restmethod -Uri "$BaseURL/id/$($_.id)/subset/location" -Method GET -Headers $Header).mobile_device.location |
                                 Select-Object -ExpandProperty department}},
                         @{n="building";e={ 
                                (Invoke-Restmethod -Uri 

Open in new window

0
Expert Spotlight: Joe Anderson (DatabaseMX)
LVL 13
Expert Spotlight: Joe Anderson (DatabaseMX)

We’ve posted a new Expert Spotlight!  Joe Anderson (DatabaseMX) has been on Experts Exchange since 2006. Learn more about this database architect, guitar aficionado, and Microsoft MVP.

We are getting rogue IP addresses and when that is happening we are having intermittent connectivity.  We have 2 dhcp servers, one windows for school and one through Sonic wall for rest of complex.  we moved our servers to a new server room and started having this issue.  We didn't change anything else.  We have unifi wifi and witches, NO USG and cant figure this out.  I have a meeting I have to be at in 13 minutes, so please ask away and I will get you as much info as I can.  We have restart we have done as much as we can think of and it is mostly one set of Atom Win 10 Notebook/Tablet computers having this issue.  And connectivity is noticed with our HVAC, automated logic.  Also if I  ping my cloud key, I get about 1/3 that don't return.

Also, school is on a 10.10.X.X 255.255.252.0 and church side is 192.168.0.1/24  we need to be clear what is behind content filter is the reason for the two subnets.

The screen shot is what we get when the Atom win 10's loose connectivity.

Remember I just a priest and I do this cause we are a poor church with a school, so be gentle...

Thanks again.
123_1.jpg
0
I was thinking about magnetism and it seems that both immobile charges are affected.

We have a wire conducting current and we have a positive charged cat.

At our rest frame the cat won't be repulsed from the wire . But in another frame when we consider the electrons (which are the current) immobile then due to length contraction the charge density of both the cat and the nuclei will be increased so a repulsive force will exist.
0
Using VBA - I need to write a REST/POST command with JSON parameters.  However, I can't seem to find a simple example that I can follow.  Does anyone have anything?
0
Hi Expert,

Could anyone please share how to create REST web service using ORDS ?

Please share with some real-time demo scenario.

Your comment is always Appreciate ..

Thanks..
0
Have DRF View based on APIView , from which I'm getting queryset as a list of tuples.
I need to serialize this queryset and pass it to rest_framework.response.Response object as a result, i.e. serializer.data.
How should Serializer class look to accomplish this task?

class SomeView(APIView):

    def post:
        result = cursor.fetchall()
        serializer = SomeSerializer(result)
        return Response(serializer.data)

Open in new window


How should I render result in SomeSerializer class? Can you give me working implementation of that?

P.S. Thera are no any model related to these results in the system.
0
how to use copyright symbol and trad mark symbol in rest api call (I need to pass  one of the Json parameter )

I need to get it in Java code and save the values in DB .

Any one have idea on this ??
0
I m using Nginx as webserver to serve some file. and here is the folder structure to be servered.


 #tree .
.
├── 1
│   ├── a.png
│   ├── attachment
│   │   └── b.png
│   └── employeeImage
│       └── a.png
├── 10
│   ├── attachment
│   └── employeeImage
│       └── a.png
├── 11
│   ├── attachment
│   └── employeeImage
│       └── a.png
├── 12
│   ├── attachment
│   └── employeeImage
│       └── a.png
├── 2
│   ├── attachment
│   │   └── b.png
│   └── employeeImage
│       └── a.png
├── 20
│   ├── attachment
│   └── employeeImage
│       └── a.png
├── 21
│   ├── attachment
│   └── employeeImage
│       └── a.png
├── 3
│   ├── attachment
│   │   └── b.png
│   └── employeeImage
│       └── a.png
├── 30
│   ├── attachment
│   └── employeeImage
│       └── a.png
├── 4
│   ├── attachment
│   │   └── b.png
│   └── employeeImage
│       └── a.png
├── 40
│   └── employeeImage
│       └── a.png
├── 5
│   ├── attachment
│   │   └── b.png
│   └── employeeImage
│       └── a.png
├── 6
│   ├── attachment
│   │   └── b.png
│   └── employeeImage
│       └── a.png
├── 7
│   ├── attachment
│   │   └── b.png
│   └── employeeImage
│       └── a.png
├── 8
│   ├── attachment
│   │   └── b.png
│   └── employeeImage
│       └── a.png
└── 9
    ├── attachment
    │   └── b.png
    └── employeeImage
        └── a.png



out of this io need only employeeImage/ to be available to the public.




and rest of the …
0
Need all steps to configure TOMCAT to run on HTTPS. I tried to use SELF signed cert and got errors.

I am trying to access a rest service from TOMCAT, the rest service is:

https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=MSFT&outputsize=full&apikey=DEMO

I am accesing this service from my self signed tomcat https running on port 8443 and did not have any luck

Here is the error message:


Type Exception Report

Message I/O error on GET request for "https://www.alphavantage.co/query": sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception
org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://www.alphavantage.co/query": sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX…
0
I need to create a public web form where users can upload a file to a folder on our organization's MS Sharepoint system.

Our website is running on the DNN 9 CMS (DotNetNuke) , so I would ideally like to be able to use their web form plugin (DNN Sharp Action Form) to make the form, but it could also be a .net web form, or a web page. I'm told that Sharepoint has an API called REST which I might use to upload files to a Sharepoint folder.

Does anyone have experience with this type of thing, I'm not yet familiar with Sharepoint.

Thanks for any info you might be able to share.

Tom
0
Introduction to R
LVL 13
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

We utilise Office 365 and all it's offerings. As such we want to allow all Office365 traffic through our Sonicwall 4650. Microsoft have recently announced the new REST web service to automatically apply the correct url and ip addresses that need to be allowed. I have spoken to Sonicwall as to how to configure the Sonicwall to automatically connect to the Microsoft web service but Sonicwall said I need to use curl but wouldn't help me at all. Has some one configured this on a Sonicwall and if so, please work with me to get this done.
0
I'm trying to use the $startswith / $istartswith filters in a REST API string and can't figure out how I would do it if I wanted to filter by two fields with an "or" operator

Here are my filters

{ "partNo": { "$startswith": "LABOR" } }

{ "upc": { "$startswith": "LABOR" } }

Open in new window


I want to include both filters with an or operator. If I use these filters individually then work fine

Also, does anyone know what the difference is between $startswith and $istartswith filters?
0
Hi All

Do we have any way to find out about the image quality using  tensorflow.
Actually I need high quality image to be accepted and need to reject the rest one.

Please share any advice on same.

Thanks.
0
Whats is the best too for Web services Testing Tool?
REST and API Testing
I'm planing to by Smart bear.Any idea is appreciated.
Company happy to pay for that.
0
I try to list posts from a custom taxonomy, but return an error by api rest v2.

https://medicplay.com.br/wp-json/wp/v2/taxonomies/vlogger_series
0
Has been almost a year that I switch to Auth0 in order to manage my customer's access to the dashboard of my application. Nowadays I need to implement access for a RESTFULL API.

If I follow the instructions in order to secure the NodeJS app using JWT it works like a charm. The issue is that I am not properly sure on the implementation for the end user in order to get the token needed for access this API.

I thought of creating the tokens on the dashboard or just use a server side implementation for the login/authentication. I did the last using the access to my own database before and worker amazingly. My issue is that I am not completely sure on how to do it for the end user using Auth0.

Would be great if you can guide me in order to implement the login/authentication side of the API using auth0 and nodejs.
0

REST

312

Solutions

608

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.

Related Topics

Top Experts In
REST
<
Monthly
>