REST

383

Solutions

686

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.

Hi

I am working on an application to access data via API using VB.NET.

I have so far managed to request for and retrieve a security token in the format as shown below:

{"success":true,"token":"eyJhbGciOiJIUzI1NiIsImNhbGciOiJERUYifQ.eNqqVkpOyc9NzMxTslLKTcxJrCzOTDRU0lFKrShQsjI0tTACYjNT01oAAAAA__8.ElaYAGRsAV43lh2OyQ4eR1wF4UIKl7tpHS7YFamVGD8"}

I need to retrieve the "token" value and use that to access the server and request specific information.

I have created a class


Public Class SecurityToken

    <JsonProperty("success")>
    Public Property Success As String

    <JsonProperty("token")>
    Public Property Token As String()

End Class

And in my code, I successfully get to this point where I get the result as shown above


Dim dataStream As Stream = response.GetResponseStream()
Dim reader As StreamReader = New StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()

I am stuck at this point in trying to split the result and retrieve just the token to use in further processing.

Any help would be appreciate.

Thank you.
0
Hi,

I have been asked to evaluate/review approximately 150 servers on our network, ranging from Server 2008 to Server 2019 list in  a spreadsheet with very limited information.   Just primary roles. (e.g. DC, DNS, RODC, SCCM Distribution Point, File and Print server, etc.)   It also lists Hyper-V, Hyper-V on workstation, etc.  

I don't have the owner information so I can't reach out to each and ask "what is this and what's it for?  The objective is to go through this giant list and label each with a "priority #" to either decommission it, upgrade the existing OS, determining the utilization of each server, apps installed, roles installed, etc.   I then need to be able to share my findings with the rest of my team so we can then determine the effort necessary to migrate, upgrade or decommission the server(s) as we look forward to our newest 2016 functional level infrastructure.  Fro example, there are 14 RODCs at branch sites, but Sites and Services is not configured properly, so that could be a priority #1 (through 5) for us.   How do you experts approach these types of tasks and projects?   What do you break things down to and label it as to what should happen to each server and where it should reside, e..g Azure.

Thanks for any information you can provide.
0
One of my employees has her fonts spontaneously change to Wingdings all over Filemaker.  This happens to her about 3x per week.  I've uninstalled and reinstalled Filemaker, which helped for a while, but in about 2 weeks, she started having the same problem.  Ran a malware and nothing came up.

The rest of us have only experienced it about twice in a year and rebooting solves the problem.  Ever seen this?  Any suggestions?
0
Hi All

I have a MS SQL script that runs a stored procedure called [Freak_APITest2] - see script code below

DECLARE @LeaderboardName		varchar		(20)
DECLARE @LeaderboardNameFull	varchar		(20) 
DECLARE @PlayerCount			varchar		(20)
DECLARE @PlayerName				varchar		(20)
DECLARE @Score					nvarchar	(20)
DECLARE @ZombiesKilled			varchar		(15)
DECLARE @Accuracy				varchar		(50)
DECLARE @DamageTaken			varchar		(20)
DECLARE @SecondsInLevel			varchar		(30)
DECLARE @Deaths					varchar		(50)

SELECT top 1 @LeaderboardName        = LeaderboardName		from ScoreBoard		where date	 = '2020-02-04 14:04:38.970'
SELECT top 1  @LeaderboardNameFull	 = LeaderboardNameFull	from ScoreBoard		where date	 = '2020-02-04 14:04:38.970'
SELECT top 1 @PlayerCount	 = PlayerCount					from ScoreBoard		where date	 = '2020-02-04 14:04:38.970'	
SELECT top 1 @PlayerName	 = PlayerName					from ScoreBoard		where date	 = '2020-02-04 14:04:38.970'	
SELECT top 1 @Score	         = Score						from ScoreBoard		where date	 = '2020-02-04 14:04:38.970'	
SELECT top 1 @ZombiesKilled	 = ZombiesKilled				from ScoreBoard		where date	 = '2020-02-04 14:04:38.970'	
SELECT top 1 @Accuracy	     = Accuracy						from ScoreBoard		where date	 = '2020-02-04 14:04:38.970'		
SELECT top 1 @DamageTaken	 = DamageTaken					from ScoreBoard		where date	 = '2020-02-04 14:04:38.970'	
SELECT top 1 @SecondsInLevel = SecondsInLevel				from ScoreBoard		where date	 = '2020-02-04 14:04:38.970'
SELECT top 1 @Deaths		 = Deaths						from ScoreBoard		

Open in new window

0
Hi,
I need to move around 6 clients G suite to 365 Business and the rest from Go daddy Workspace email to 365 Business.

For the small amount of clients can I do the following?

1. Setup 365 Business and add users
2. Verify Domain
3. Export data from outlook to PST file
4. Change MX to point at 365
5. Reimport data from PST to outlook?
6. Cancel Subscription with Gsuite and Go daddy

Or do I need to use a migration tool ?
0
I am using Outlook 2016 and Outlook 2019, with Exchange Online.  When creating a recurring appointment that includes a room resource, if the room is booked for just one of those recurring appointments, the room fails to book for any of the dates.

How do I create a recurring appointment, that, if a room is booked for just one of those occasions, the rest of the occasions the room is booked - without having to create separate appointments or pull appointments out of a series, then having to rebook both the series again and the separate appointment.

I know previous versions of Exchange let you book recurring appointment resources if they were free and only warned that the busy ones couldn't be booked.
0
How to send String Array ( string [] )in Request Params for REST API in C#?


This does not work.

public string GetLocation(string [] myItems)
{

           //var item = myItems;
            var item = "[\"Alabama\", \"Texas\"]";   //Test    
            var regionCode = "South";


            var url = $"https://MyLocation.com/api/GetLocation?MySearch={ item }&region={ regionCode }";

            var httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
            httpWebRequest.Method = "POST";

            var strResult = string.Empty;

            var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
            using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
            {
                var result = streamReader.ReadToEnd();
                strResult = result;
            }

            string myMsgResult = strResult;


}
0
I am looking into developing a rest api in .net core using C#. is there a good tutorial/videos or just even pointers. my primary concern are with the tools and how I should layout the architecture. I know there is entity framework for ORM, but I would like to use dapper with mysql. also is there certain design pattern that is used or recommended like repository pattern. I have read usually specification pattern is used with repository pattern.

I don't want to make my codebase/architecture/framework to complicated and one thing I like about .net core is now we can just use what middle ware we want and also dependency injection is also inbuilt. in this light, what are few things that would be helpful to build a robust application without making it too complicated.
0
I set up win.interstagebpm.com with let's encrypt and I was able to get the page to go https://win.interstagebpm.com

However I tried to setup reverse proxy with nginx and by editing httpd files
https://www.centosblog.com/configure-apache-https-reverse-proxy-centos-linux/

However this didn't work. Also the machine ran out of disk space and had to fix that. When that was fixed https://win.interstagebpm.com was complaining that it wasn't a secure site meaning the ssl certificate wasn't being registered.
I've also uninstalled ngninx

What am I doing wrong? I would like to reverse proxy the rest of the site but the main page https://win.interstagebpm.com is not working
0
Hi, when I click on link "Comments" a modal popup opens up and shows content, therefore it does what it is supposed to.
 
Going to my issue:
In the first scenario, it happens what I want but some other code does not get implemented. In this case, I place the "@section" inside Index.cshtml and the modal popup is rendered in the middle of the page with some styling(which is what I want),  but the datatable and yadcf code above the @section does not seem to get executed(datatable filters not there).  I show this scenario in jpeg attached called "Modal Popup Centered".

On the other hand, in the second scenario, if I put the @section inside the "ViewAll" view the datatable works correctly, the modal popup come up as well, but it does not get the rest of the functionalities(like being centered and the style).  I show this second scenario in the jpeg called "Modal Popup Not Centered".

I would like to leave the code in the ViewAll view(second scenario) as this is the one related to the modal popup.  Also, when I do that the attached error comes up.  I looked the error up and it seems there may be some incompatibility?  If so, why would it work on the index page then?

Could you please help?  I spent lots of time trying to resolve the issue but was unsuccessful.

THIS IS THE LAYOUT VIEW CODE:
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title 

Open in new window

0
Hi,
I am trying to fetch some data by doing a query to Salesforce.com DB.
For that I use a REST adapter and I have to pass a query in the REST URL.

I have the following Query to pass
select AccountId, CreatedDate, ActivatedDate, (select CreatedById, from OrderItems) from Order

and I am able to successfully pass it using the following URL string
https://XXXXXXXX.com/services/data/v20.0/query/?q=SELECT+AccountId%2c+CreatedDate%2c+ActivatedDate%2c+%28SELECT+CreatedById+from+OrderItems%29+from+Order

which results in the following output
{
    "totalSize": 1,
    "done": true,
    "records": [
        {
            "attributes": {
                "type": "Order",
                "url": "/services/data/v20.0/sobjects/Order/XXXXXXXXXX"
            },
            "AccountId": "YYYYYFFFFFFFFFF",
            "CreatedDate": "2019-11-22T01:30:16.000+0000",
            "ActivatedDate": null,
            "OrderItems": null
        }
    ]
}

My next task is to pass the "CreatedDate" value as "2019-11-22T01:30:16.000+0000" to fetch the same output result. So I am trying to figure out how I can build the query to pass the date string with all the encoded characters ?
0
I am trying to change the locale of a windows 7 pro machine from English to Spanish. I downloaded the language pack, changed the region and keyboard. Went to the admin tab and copied the setting yet the menus', welcome screen, etc are still in english. The keyboard is spanish layout and when you open the browser it is in spanish....How to I get the rest to change?
0
I just installed a new version of server 2019 and have replaced the 2008 server that acted as the RDP server. I can connect to the 2019 server without any problem with the windows 7-10 remote desktop client. What I can't connect with is our terminal server clients that have been built with Linux (puppy) and rdesktop. They worked fine under 2008 but will not do anything (no error message or other info). I can remotely connect to any of the other servers in the building (the rest are all 2008 R2.)

I have added all of the domain users to the people who can connect list.  The restriction for Network Level authentication is turned off.

I haven't' worked with 2019 yet so I'm not coming up with any ideas of what the problem might be.

Can someone point me in the right direction for a solution?

BTW: I will not be able to get back to this until next week because they are shutting down at the end of the day until then for the holiday.

Thanks for the assist with this.

Regards,

Bill
0
I've a query I'm building against a SQL Server, in the query, I have a TEXT column that I need to break apart, and the break has to happen at a certain delimiter(s), I'm using the String_Split function, and I'm able to capture the first LEFT characters that are to the left of the FIRST delimiter (which is a ">" symbol), but the rest of the string is my primary problem now, I have another delimiter in the string, and it's of the same type, a ">" symbol, so here's an example.
The string: nu>11BcH123>nic1, I'm getting the (nu) out, but I need to get the (BcH123) out and into its own column, and then get the (nic1) into its own column as well.

Your attention is very much appreciated.
0
On internal intranet the C/C++ client sends out REST-like queries via TCP/IP and receives an XML response from the Java server. If the REST query loops fetching 3 records at a time, the total time to accumulate 90000 records is about 10x longer than if we fetch 100 records at a time. We will be performing a number of timing tests to isolate the cause. In anticipation that the problem may be the slow TCP/IP start due to initial small windowing, what settings are there to tell TCP/IP to start off with the largest (or larger) window size possible?

We are on 64-bit RHEL servers, and I assume that since the client/server are run on an intranet self-contained within the company, that we do not have to be concerned about congestion.

Thanks,
Paul
0
Hello!

I'm trying to populate a combobox inside of a datagridview based on what shift is selected in the Operators Filter combobox.  I've been successful in populating the top combo in the datagridview but no data is showing in the rest of the rows.

There are 4 shifts, A,B,C and D which all have operators assigned.  However on any given day an operator that normally works C shift may come in to cover for someone on A.  When I bound the combobox directly to the OperatorsBindingSource every time I would filter by selecting another shift the values already selected in the dgv would disappear because the name did not exist in the filtered binding source.  As a workaround I'm trying to handle it this way.

Here is an image of the form:
ComboIssue.jpg
Here is the code I have so far that is only populating the top combo in the dgv:
private void GetOperators()
        {
            string opshift = cboOperatorFilter.SelectedItem.ToString();

            DataTable opNames = new DataTable();

            var filteredOps = from row in trackingDataSet.Operators.AsEnumerable()
                              where row.Field<string>("HomeShift") == opshift
                              select row.OperatorName.ToString();

            opNames.Columns.Add("OperatorName", typeof(string));
            foreach(string str in filteredOps)
            {
                DataRow row = opNames.NewRow();
                row["OperatorName"] = str;
                

Open in new window

0
Hi Expert,
Can you help me to find out where i'm doing mistake or how to call this and also I used  newtonsoft

Following way i have tried to Deserialize Json. The results from REST services working fine
(candidateResults) i iwll get the data.

 var jcCandidate1 = JsonConvert.DeserializeObject<List<candidateDetails>>(candidateResults);

also i tried
 var jcCandidate1 = JsonConvert.DeserializeObject<List<candidateDetails>>(candidateResults);

Open in new window



all classes  created according to Json Results. (go to Edit special paste -> select Json)

namespace TestConsolApp
{
   
    public class candidateMain
    {
        public candidateDetails[] Property1 { get; set; }
    }

    public class candidateDetails
    {
        public string _id { get; set; }
        public DateTime creation_date { get; set; }
        public string email_address { get; set; }
        public string headline { get; set; }
        public string initial { get; set; }
        public string name { get; set; }
        public string origin { get; set; }
        public string phone_number { get; set; }
        public candidateResume resume { get; set; }
        public candidateSource source { get; set; }
        public candidateStage stage { get; set; }
        //public object[] tags { get; set; }
        public DateTime updated_date { get; set; }
    }

    public class candidateResume
    {
        public string url { get; set; }
    }

    public class candidateSource
    {
        public

Open in new window

0
Hi
I would like to be sending some short messages system (SMS) from Ms Access App to my colleagues for any urgent issue at hand from my laptop, for the URL I have to organize from a service provider for a fee. Now instead of using a modem, I want use REST API, I have to get URL from the service provider. Below is my scant VBA code which I intend to use, also help to complete !

SMS CODE

Private Sub CmdSmsLines_Click()
Dim strURL As String
  Dim neMb As String
  Dim msGe As String
  Dim appIE As Object
  
    Set appIE = CreateObject("InternetExplorer.Application")
    neMb = Me.txtneMb.Value
    msGe = Me.txtmsGe.Value
    
    
    strURL = "http://bhashsms.com/api/XXXXX=success&pass=RRRRR&sender=ZZZZZ=" & neMb & "text=" & msGe & "priority=ndnd&stype = normal"
       
         
   With appIE
        .Navigate strURL
        ' uncomment the line below if you want to watch the code execute, or for debugging
        '.Visible = True
       
    End With
    ' loop until the page finishes loading
    Do While appIE.busy
        DoEvents
    Loop

    appIE.Quit
End Sub

Open in new window

I intend to use two controls as in memo form see below:
cellNumber:
SMSMessages:

Suppose I want to send the message to 4 people at one go, how do I type in the phone numbers in the memo control box SMSMessages: or msGe
0
I am trying to connect to my SharePoint webservice through a add on for VS code called SPGo.  I am getting a 407 error. Proxy Authentication Required. I then am trying to use node-sp-auth to find the correct parameters so I can use SPGo. My company uses OneLogin (ADFS). I don't understand how to make the call to get the required information for the proxy.  I think I am supposed to pass the user and pass with a key using SAML.  

On another note.  I am making a call from within SharePoint to the API to get my list items without issues.  I think the issue is because of MFA.  I do however have the proxy script address.

The call is just:

$.ajax({
			url: "../_api/web/lists/....",
	        type: "GET",
	        headers: {
	            "accept": "application/json;odata=verbose",
	        }

Open in new window

0
A friend sent me a hoax warning not to accept Facebook friend requests from Andrea Wilson. That it could cause trouble:

"Please tell all the contacts in your messenger list not to accept friendship request from Andrea Wilson . She is a hacker and has the system connected to your Facebook account. If one of your contacts accepts it, you will also be hacked, so make sure that all your friends know it. Thanks."


However, two other friends told me it was a hoax and I found two links that SEEM to indicate they're correct:
https://www.hoax-slayer.net/andrea-wilson-friendship-request-hacker-hoax/?fbclid=IwAR0Oyj4C-_VPi5vfOu-2J7-Xy0rzE1439NtB4fzPeZ3FXo6uFIhuHdTk6n0

https://www.snopes.com/fact-check/social-media-hacker-warning/?fbclid=IwAR0UZDeV6OipD7eb2ykB2-Td5wV2SoMYQ4kCGsvbzx_NNt8jEnuNw5lOp5U
(Search on "Andrea")

Based on the below can I rest assured the original msg I received is a hoax? Thanks.
0
Hi all,

We have been asked by a client to open private access to our API. This will be monetized, and they would like us to provide a pricing model.

I have no idea where to start, i know the types of ways we can charge them (per user, usage, requests, etc), but i have no idea which is best for our use case, and how do we even go about building a mechanism to monitor usage for billing.

Our API is REST based (currently for internal use of a webapp and mobile app) and sends data to the cloud to be run against ML models which then spit back confidence scores to the applications.

My next question is regarding architecture, would we implement a layer between our ML Service and our clients that would implement oauth2/monitoring of API usage?
1
Move a Wordpress site from wildwestdomains (Godaddy's Sister) Deluxe hosting to Godaddy Deluxe hosting CPanel site. The site won't load I get this from error log. I did not design this and I have never moved WP sites before so any help would be great.

[03-Oct-2019 08:11:45 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function site_url() in /home/mivn8z69yz1h/public_html/danatannenbaummd.com/wp/wordpress/wp-content/plugins/gravityforms/includes/webapi/webapi.php:21
Stack trace:
#0 /home/mivn8z69yz1h/public_html/danatannenbaummd.com/wp/wordpress/wp-content/plugins/gravityforms/gravityforms.php(162): require_once()
#1 /home/mivn8z69yz1h/public_html/danatannenbaummd.com/wp/wordpress/wp-settings.php(305): include_once('/home/mivn8z69y...')
#2 /home/mivn8z69yz1h/public_html/danatannenbaummd.com/wp/wordpress/wp-config.php(179): require_once('/home/mivn8z69y...')
#3 /home/mivn8z69yz1h/public_html/danatannenbaummd.com/wp/wordpress/wp-load.php(37): require_once('/home/mivn8z69y...')
#4 /home/mivn8z69yz1h/public_html/danatannenbaummd.com/wp/wordpress/wp-blog-header.php(13): require_once('/home/mivn8z69y...')
#5 /home/mivn8z69yz1h/public_html/danatannenbaummd.com/index.php(17): require('/home/mivn8z69y...')
#6 {main}
  thrown in /home/mivn8z69yz1h/public_html/danatannenbaummd.com/wp/wordpress/wp-content/plugins/gravityforms/includes/webapi/webapi.php on line 21

Open in new window


Line 21 is:
define( 'GFWEBAPI_API_BASE_URL', site_url( GFWEBAPI_SLUG ) );

the PHP is:

Open in new window

0
Hi, to everybody.
This is my promotion table:
SELECT [LOT_CTL_NO]
      ,[LOT_SERIAL]
      ,[LOT_SUM_POINT]
      ,[LOT_SENIORITY_POINT]
      ,[LOT_CERTIFICAT_POINT]
      ,[LOT_PROM_DATE_47]
      ,[LOT_PROM_DATE_46]
      ,[LOT_PROM_DATE_45]
      ,[LOT_PROM_DATE_44]
      ,[LOT_PROM_DATE_43]
FROM [TBNOMLOT]
order by LOT_SERIAL
in the attached Excel file there are 234 rows(employees). They are ordered by [LOT_SERIAL] .
if employees are equals in LOT_SUM_POINT , LOT_SENIORITY_POINT , LOT_PROM_DATE_46 , LOT_PROM_DATE_45 ,  [LOT_PROM_DATE_44 and  LOT_PROM_DATE_43  
then do the lot operator "NEWID()"  here, to resort the equal rows only, and then put them again in the same sequence but with the new order.
Like for example
 lot01
Here I need to do the LOT for the first 7 records only by (LOT_CTL_NO) and bring them back to the main list again, in the same position.
And so on to the rest of all records when there is equality.
LOT.xlsx
see attached excel file
0
HI, I am new to leaflet js.
I am calling a rest from esri API,  the image is not a tile, it is a dynamic layer. How can I call the service with multiple layers?

Thanks
0
Create a RESTful service (called News-API) using asp.net web api

TODO
● Create a Web-API .NET Core project for a RESTful service
● On startup, create a database by using EF Core (from nuget) containing the table “News”:
○ Id INTEGER PRIMARY KEY
○ Title VARCHAR(100) NOT NULL
○ Content text NULL
● Populate the table with a few dummy records (5 max)
● Add an API-Controller with the name “NewsController”
● Add an action to get all the records
● Add an action to get a specific record (primary key)
● Add an action to add a record
● Add an action to update a record
● Add an action to delete a record
0

REST

383

Solutions

686

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.