DOTCMS REST API

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

DOTCMS REST API

Henry Versemann

I’m getting a “(401) Unauthorized” exception returned from trying to send an add new content request to the REST API.

 

I’m trying to send to this URI:

 

$url = "https://www.stchas.edu:443/api/content/publish/1"

 

Using these headers:

 

$headers = @{"Authorization"=$authHdrSffx} (for basic authentication)

$headers.Add("Accept","text/plain")

$headers.Add("Content-Type","application/json")

 

And the following body of data (in json format):

 

{

    "stName": "Employees",

       "languageId": 1,

       "prefix": "",

       "firstName": "Dum",

       "middleInitial": "D",

       "lastName": "Dummy",

       "nickname": "Dummy",

       "title": "Adjunct Faculty",

       "type1": "adjunct",

       "phoneNumber": "636-922-9999",

       "email": "[hidden email]",

       "fax": "999-999-9999",

       "picture": "",

       "quickEducation": "Bachelors",

       "education": "Bachelors",

       "bio": "nothing",

       "building": "Administration",

       "room": "4123",

       "slug": "",

       "pagetitle": "",

       "headline": ""

}

 

And I am trying to send the request using the POST method via https (port 443).

 

I’m using the PowerShell Invoke-WebRequest commandlet like this to do it:

 

Invoke-WebRequest -URI $url -Body $body -Headers $headers -Method POST

 

I’m not sure what exactly the problem is, since I thought I had everything correct based on the documentation for the Invoke-WebRequest commandlet, including the credentials part of the documentation.

 

Is it possible that the url I’m trying to hit is not correct, since it is listed under the examples for the Original API, instead of the New API?

 

Any help would be greatly appreciated.

 

Thanks.

 

Henry

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700C9334EA49EFE1EC3CA67AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API

Nathan Keiter

I find it helpful to test RESTful APIs using Google’s “Advanced REST Client” program. (It’s free.)

 

https://advancedrestclient.com/

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US

 

Get it to work there first, then try it with your script.

 

The 401 seems to be a permissions error. Check the access log or dotcms log for clues.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Henry Versemann
Sent: Thursday, October 12, 2017 10:44 AM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API

 

I’m getting a “(401) Unauthorized” exception returned from trying to send an add new content request to the REST API.

 

I’m trying to send to this URI:

 

$url = "https://www.stchas.edu:443/api/content/publish/1"

 

Using these headers:

 

$headers = @{"Authorization"=$authHdrSffx} (for basic authentication)

$headers.Add("Accept","text/plain")

$headers.Add("Content-Type","application/json")

 

And the following body of data (in json format):

 

{

    "stName": "Employees",

       "languageId": 1,

       "prefix": "",

       "firstName": "Dum",

       "middleInitial": "D",

       "lastName": "Dummy",

       "nickname": "Dummy",

       "title": "Adjunct Faculty",

       "type1": "adjunct",

       "phoneNumber": "636-922-9999",

       "email": "[hidden email]",

       "fax": "999-999-9999",

       "picture": "",

       "quickEducation": "Bachelors",

       "education": "Bachelors",

       "bio": "nothing",

       "building": "Administration",

       "room": "4123",

       "slug": "",

       "pagetitle": "",

       "headline": ""

}

 

And I am trying to send the request using the POST method via https (port 443).

 

I’m using the PowerShell Invoke-WebRequest commandlet like this to do it:

 

Invoke-WebRequest -URI $url -Body $body -Headers $headers -Method POST

 

I’m not sure what exactly the problem is, since I thought I had everything correct based on the documentation for the Invoke-WebRequest commandlet, including the credentials part of the documentation.

 

Is it possible that the url I’m trying to hit is not correct, since it is listed under the examples for the Original API, instead of the New API?

 

Any help would be greatly appreciated.

 

Thanks.

 

Henry

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700C9334EA49EFE1EC3CA67AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/3877388989f345ca82aa1af68ad83180%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API

Mark Pitely
Set that content type permission to CMS_Anonymous (publish) to test. I don't see you sending any credentials-  dotCMS *should* be locking you out.

Mark Pitely
Marywood University

On Thu, Oct 12, 2017 at 10:53 AM, Nathan Keiter <[hidden email]> wrote:

I find it helpful to test RESTful APIs using Google’s “Advanced REST Client” program. (It’s free.)

 

https://advancedrestclient.com/

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US

 

Get it to work there first, then try it with your script.

 

The 401 seems to be a permissions error. Check the access log or dotcms log for clues.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: <a href="tel:(717)%20337-6993" value="+17173376993" target="_blank">717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Henry Versemann
Sent: Thursday, October 12, 2017 10:44 AM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API

 

I’m getting a “(401) Unauthorized” exception returned from trying to send an add new content request to the REST API.

 

I’m trying to send to this URI:

 

$url = "https://www.stchas.edu:443/api/content/publish/1"

 

Using these headers:

 

$headers = @{"Authorization"=$authHdrSffx} (for basic authentication)

$headers.Add("Accept","text/plain")

$headers.Add("Content-Type","application/json")

 

And the following body of data (in json format):

 

{

    "stName": "Employees",

       "languageId": 1,

       "prefix": "",

       "firstName": "Dum",

       "middleInitial": "D",

       "lastName": "Dummy",

       "nickname": "Dummy",

       "title": "Adjunct Faculty",

       "type1": "adjunct",

       "phoneNumber": "<a href="tel:(636)%20922-9999" value="+16369229999" target="_blank">636-922-9999",

       "email": "[hidden email]",

       "fax": "999-999-9999",

       "picture": "",

       "quickEducation": "Bachelors",

       "education": "Bachelors",

       "bio": "nothing",

       "building": "Administration",

       "room": "4123",

       "slug": "",

       "pagetitle": "",

       "headline": ""

}

 

And I am trying to send the request using the POST method via https (port 443).

 

I’m using the PowerShell Invoke-WebRequest commandlet like this to do it:

 

Invoke-WebRequest -URI $url -Body $body -Headers $headers -Method POST

 

I’m not sure what exactly the problem is, since I thought I had everything correct based on the documentation for the Invoke-WebRequest commandlet, including the credentials part of the documentation.

 

Is it possible that the url I’m trying to hit is not correct, since it is listed under the examples for the Original API, instead of the New API?

 

Any help would be greatly appreciated.

 

Thanks.

 

Henry

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700C9334EA49EFE1EC3CA67AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/3877388989f345ca82aa1af68ad83180%40exch13c.ms.gettysburg.edu.

For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqM_Bk-Q1PjE2CAV4gOdD-PjxZdacX_-45gOYq3Dn7FmAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API

Nathan Keiter

He’s using a base 64 encoded authentication string. That happens to be my preferred method as well.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Mark Pitely
Sent: Thursday, October 12, 2017 11:01 AM
To: [hidden email]
Subject: Re: [dotcms] RE: DOTCMS REST API

 

Set that content type permission to CMS_Anonymous (publish) to test. I don't see you sending any credentials-  dotCMS *should* be locking you out.

Mark Pitely

Marywood University

 

On Thu, Oct 12, 2017 at 10:53 AM, Nathan Keiter <[hidden email]> wrote:

I find it helpful to test RESTful APIs using Google’s “Advanced REST Client” program. (It’s free.)

 

https://advancedrestclient.com/

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US

 

Get it to work there first, then try it with your script.

 

The 401 seems to be a permissions error. Check the access log or dotcms log for clues.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | <a href="https://maps.google.com/?q=300&#43;North&#43;Washington&#43;Street&#43;%7C&#43;Gettysburg,&#43;PA&#43;17325&amp;entry=gmail&amp;source=g"> 300 North Washington Street | Gettysburg, PA 17325
Phone: <a href="tel:(717)%20337-6993" target="_blank"> 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Henry Versemann
Sent: Thursday, October 12, 2017 10:44 AM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API

 

I’m getting a “(401) Unauthorized” exception returned from trying to send an add new content request to the REST API.

 

I’m trying to send to this URI:

 

$url = "https://www.stchas.edu:443/api/content/publish/1"

 

Using these headers:

 

$headers = @{"Authorization"=$authHdrSffx} (for basic authentication)

$headers.Add("Accept","text/plain")

$headers.Add("Content-Type","application/json")

 

And the following body of data (in json format):

 

{

    "stName": "Employees",

       "languageId": 1,

       "prefix": "",

       "firstName": "Dum",

       "middleInitial": "D",

       "lastName": "Dummy",

       "nickname": "Dummy",

       "title": "Adjunct Faculty",

       "type1": "adjunct",

       "phoneNumber": "<a href="tel:(636)%20922-9999" target="_blank">636-922-9999",

       "email": "[hidden email]",

       "fax": "999-999-9999",

       "picture": "",

       "quickEducation": "Bachelors",

       "education": "Bachelors",

       "bio": "nothing",

       "building": "Administration",

       "room": "4123",

       "slug": "",

       "pagetitle": "",

       "headline": ""

}

 

And I am trying to send the request using the POST method via https (port 443).

 

I’m using the PowerShell Invoke-WebRequest commandlet like this to do it:

 

Invoke-WebRequest -URI $url -Body $body -Headers $headers -Method POST

 

I’m not sure what exactly the problem is, since I thought I had everything correct based on the documentation for the Invoke-WebRequest commandlet, including the credentials part of the documentation.

 

Is it possible that the url I’m trying to hit is not correct, since it is listed under the examples for the Original API, instead of the New API?

 

Any help would be greatly appreciated.

 

Thanks.

 

Henry

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700C9334EA49EFE1EC3CA67AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/3877388989f345ca82aa1af68ad83180%40exch13c.ms.gettysburg.edu.


For more options, visit https://groups.google.com/d/optout.

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqM_Bk-Q1PjE2CAV4gOdD-PjxZdacX_-45gOYq3Dn7FmAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/03d237eb6d4c4223931a6d814203496b%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API

Henry Versemann
In reply to this post by Nathan Keiter

Thanks Nathan. I’ll check it out.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nathan Keiter
Sent: Thursday, October 12, 2017 9:53 AM
To: [hidden email]
Subject: [dotcms] RE: DOTCMS REST API

 

I find it helpful to test RESTful APIs using Google’s “Advanced REST Client” program. (It’s free.)

 

https://advancedrestclient.com/

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US

 

Get it to work there first, then try it with your script.

 

The 401 seems to be a permissions error. Check the access log or dotcms log for clues.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [[hidden email]] On Behalf Of Henry Versemann
Sent: Thursday, October 12, 2017 10:44 AM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API

 

I’m getting a “(401) Unauthorized” exception returned from trying to send an add new content request to the REST API.

 

I’m trying to send to this URI:

 

$url = "https://www.stchas.edu:443/api/content/publish/1"

 

Using these headers:

 

$headers = @{"Authorization"=$authHdrSffx} (for basic authentication)

$headers.Add("Accept","text/plain")

$headers.Add("Content-Type","application/json")

 

And the following body of data (in json format):

 

{

    "stName": "Employees",

       "languageId": 1,

       "prefix": "",

       "firstName": "Dum",

       "middleInitial": "D",

       "lastName": "Dummy",

       "nickname": "Dummy",

       "title": "Adjunct Faculty",

       "type1": "adjunct",

       "phoneNumber": "636-922-9999",

       "email": "[hidden email]",

       "fax": "999-999-9999",

       "picture": "",

       "quickEducation": "Bachelors",

       "education": "Bachelors",

       "bio": "nothing",

       "building": "Administration",

       "room": "4123",

       "slug": "",

       "pagetitle": "",

       "headline": ""

}

 

And I am trying to send the request using the POST method via https (port 443).

 

I’m using the PowerShell Invoke-WebRequest commandlet like this to do it:

 

Invoke-WebRequest -URI $url -Body $body -Headers $headers -Method POST

 

I’m not sure what exactly the problem is, since I thought I had everything correct based on the documentation for the Invoke-WebRequest commandlet, including the credentials part of the documentation.

 

Is it possible that the url I’m trying to hit is not correct, since it is listed under the examples for the Original API, instead of the New API?

 

Any help would be greatly appreciated.

 

Thanks.

 

Henry

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700C9334EA49EFE1EC3CA67AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/3877388989f345ca82aa1af68ad83180%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700EB3E78FF74963E58E0F3AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API

Henry Versemann
In reply to this post by Mark Pitely

Thanks Mark.

I am using Base64.

 

Henry

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Mark Pitely
Sent: Thursday, October 12, 2017 10:01 AM
To: [hidden email]
Subject: Re: [dotcms] RE: DOTCMS REST API

 

Set that content type permission to CMS_Anonymous (publish) to test. I don't see you sending any credentials-  dotCMS *should* be locking you out.

Mark Pitely

Marywood University

 

On Thu, Oct 12, 2017 at 10:53 AM, Nathan Keiter <[hidden email]> wrote:

I find it helpful to test RESTful APIs using Google’s “Advanced REST Client” program. (It’s free.)

 

https://advancedrestclient.com/

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US

 

Get it to work there first, then try it with your script.

 

The 401 seems to be a permissions error. Check the access log or dotcms log for clues.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | <a href="https://maps.google.com/?q=300&#43;North&#43;Washington&#43;Street&#43;%7C&#43;Gettysburg,&#43;PA&#43;17325&amp;entry=gmail&amp;source=g"> 300 North Washington Street | Gettysburg, PA 17325
Phone: <a href="tel:(717)%20337-6993" target="_blank"> 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Henry Versemann
Sent: Thursday, October 12, 2017 10:44 AM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API

 

I’m getting a “(401) Unauthorized” exception returned from trying to send an add new content request to the REST API.

 

I’m trying to send to this URI:

 

$url = "https://www.stchas.edu:443/api/content/publish/1"

 

Using these headers:

 

$headers = @{"Authorization"=$authHdrSffx} (for basic authentication)

$headers.Add("Accept","text/plain")

$headers.Add("Content-Type","application/json")

 

And the following body of data (in json format):

 

{

    "stName": "Employees",

       "languageId": 1,

       "prefix": "",

       "firstName": "Dum",

       "middleInitial": "D",

       "lastName": "Dummy",

       "nickname": "Dummy",

       "title": "Adjunct Faculty",

       "type1": "adjunct",

       "phoneNumber": "<a href="tel:(636)%20922-9999" target="_blank">636-922-9999",

       "email": "[hidden email]",

       "fax": "999-999-9999",

       "picture": "",

       "quickEducation": "Bachelors",

       "education": "Bachelors",

       "bio": "nothing",

       "building": "Administration",

       "room": "4123",

       "slug": "",

       "pagetitle": "",

       "headline": ""

}

 

And I am trying to send the request using the POST method via https (port 443).

 

I’m using the PowerShell Invoke-WebRequest commandlet like this to do it:

 

Invoke-WebRequest -URI $url -Body $body -Headers $headers -Method POST

 

I’m not sure what exactly the problem is, since I thought I had everything correct based on the documentation for the Invoke-WebRequest commandlet, including the credentials part of the documentation.

 

Is it possible that the url I’m trying to hit is not correct, since it is listed under the examples for the Original API, instead of the New API?

 

Any help would be greatly appreciated.

 

Thanks.

 

Henry

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700C9334EA49EFE1EC3CA67AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/3877388989f345ca82aa1af68ad83180%40exch13c.ms.gettysburg.edu.


For more options, visit https://groups.google.com/d/optout.

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqM_Bk-Q1PjE2CAV4gOdD-PjxZdacX_-45gOYq3Dn7FmAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB17004DA9F53B0F731BC264AFAD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API

Nathan Keiter
In reply to this post by Henry Versemann

In Google Advanced Rest Client, if you right click in headers and choose authentication, it will ask for username/password and automatically base 64 encode the value for you. J

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Henry Versemann
Sent: Thursday, October 12, 2017 11:24 AM
To: [hidden email]
Subject: [dotcms] RE: DOTCMS REST API

 

Thanks Nathan. I’ll check it out.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nathan Keiter
Sent: Thursday, October 12, 2017 9:53 AM
To: [hidden email]
Subject: [dotcms] RE: DOTCMS REST API

 

I find it helpful to test RESTful APIs using Google’s “Advanced REST Client” program. (It’s free.)

 

https://advancedrestclient.com/

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US

 

Get it to work there first, then try it with your script.

 

The 401 seems to be a permissions error. Check the access log or dotcms log for clues.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [[hidden email]] On Behalf Of Henry Versemann
Sent: Thursday, October 12, 2017 10:44 AM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API

 

I’m getting a “(401) Unauthorized” exception returned from trying to send an add new content request to the REST API.

 

I’m trying to send to this URI:

 

$url = "https://www.stchas.edu:443/api/content/publish/1"

 

Using these headers:

 

$headers = @{"Authorization"=$authHdrSffx} (for basic authentication)

$headers.Add("Accept","text/plain")

$headers.Add("Content-Type","application/json")

 

And the following body of data (in json format):

 

{

    "stName": "Employees",

       "languageId": 1,

       "prefix": "",

       "firstName": "Dum",

       "middleInitial": "D",

       "lastName": "Dummy",

       "nickname": "Dummy",

       "title": "Adjunct Faculty",

       "type1": "adjunct",

       "phoneNumber": "636-922-9999",

       "email": "[hidden email]",

       "fax": "999-999-9999",

       "picture": "",

       "quickEducation": "Bachelors",

       "education": "Bachelors",

       "bio": "nothing",

       "building": "Administration",

       "room": "4123",

       "slug": "",

       "pagetitle": "",

       "headline": ""

}

 

And I am trying to send the request using the POST method via https (port 443).

 

I’m using the PowerShell Invoke-WebRequest commandlet like this to do it:

 

Invoke-WebRequest -URI $url -Body $body -Headers $headers -Method POST

 

I’m not sure what exactly the problem is, since I thought I had everything correct based on the documentation for the Invoke-WebRequest commandlet, including the credentials part of the documentation.

 

Is it possible that the url I’m trying to hit is not correct, since it is listed under the examples for the Original API, instead of the New API?

 

Any help would be greatly appreciated.

 

Thanks.

 

Henry

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700C9334EA49EFE1EC3CA67AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/3877388989f345ca82aa1af68ad83180%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700EB3E78FF74963E58E0F3AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b0347f1857e94ccb89e3d9cf1d8134e7%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API

Henry Versemann

Thanks Nathan.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nathan Keiter
Sent: Thursday, October 12, 2017 10:27 AM
To: [hidden email]
Subject: [dotcms] RE: DOTCMS REST API

 

In Google Advanced Rest Client, if you right click in headers and choose authentication, it will ask for username/password and automatically base 64 encode the value for you. J

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [[hidden email]] On Behalf Of Henry Versemann
Sent: Thursday, October 12, 2017 11:24 AM
To: [hidden email]
Subject: [dotcms] RE: DOTCMS REST API

 

Thanks Nathan. I’ll check it out.

 

From: [hidden email] [[hidden email]] On Behalf Of Nathan Keiter
Sent: Thursday, October 12, 2017 9:53 AM
To: [hidden email]
Subject: [dotcms] RE: DOTCMS REST API

 

I find it helpful to test RESTful APIs using Google’s “Advanced REST Client” program. (It’s free.)

 

https://advancedrestclient.com/

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US

 

Get it to work there first, then try it with your script.

 

The 401 seems to be a permissions error. Check the access log or dotcms log for clues.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [[hidden email]] On Behalf Of Henry Versemann
Sent: Thursday, October 12, 2017 10:44 AM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API

 

I’m getting a “(401) Unauthorized” exception returned from trying to send an add new content request to the REST API.

 

I’m trying to send to this URI:

 

$url = "https://www.stchas.edu:443/api/content/publish/1"

 

Using these headers:

 

$headers = @{"Authorization"=$authHdrSffx} (for basic authentication)

$headers.Add("Accept","text/plain")

$headers.Add("Content-Type","application/json")

 

And the following body of data (in json format):

 

{

    "stName": "Employees",

       "languageId": 1,

       "prefix": "",

       "firstName": "Dum",

       "middleInitial": "D",

       "lastName": "Dummy",

       "nickname": "Dummy",

       "title": "Adjunct Faculty",

       "type1": "adjunct",

       "phoneNumber": "636-922-9999",

       "email": "[hidden email]",

       "fax": "999-999-9999",

       "picture": "",

       "quickEducation": "Bachelors",

       "education": "Bachelors",

       "bio": "nothing",

       "building": "Administration",

       "room": "4123",

       "slug": "",

       "pagetitle": "",

       "headline": ""

}

 

And I am trying to send the request using the POST method via https (port 443).

 

I’m using the PowerShell Invoke-WebRequest commandlet like this to do it:

 

Invoke-WebRequest -URI $url -Body $body -Headers $headers -Method POST

 

I’m not sure what exactly the problem is, since I thought I had everything correct based on the documentation for the Invoke-WebRequest commandlet, including the credentials part of the documentation.

 

Is it possible that the url I’m trying to hit is not correct, since it is listed under the examples for the Original API, instead of the New API?

 

Any help would be greatly appreciated.

 

Thanks.

 

Henry

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700C9334EA49EFE1EC3CA67AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/3877388989f345ca82aa1af68ad83180%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700EB3E78FF74963E58E0F3AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b0347f1857e94ccb89e3d9cf1d8134e7%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB17009B363183E4668AE91995AD4B0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

DOTCMS REST API

Henry Versemann
In reply to this post by Henry Versemann

I’m trying to search our departments structure for a value of “Network Operations” and after some dynamic constructing and editing of the REST API url to inquire against the final url looks like this:

 

<a href="https://www.stchas.edu:443/api/content/query/&#43;contentType:Departments%20&#43;_all:network*%20&#43;_all:operations*%20languageId:1%20&#43;deleted:false%20&#43;live:true/orderby/modDate%20desc">https://www.stchas.edu:443/api/content/query/+contentType:Departments%20+_all:network*%20+_all:operations*%20languageId:1%20+deleted:false%20+live:true/orderby/modDate%20desc

 

and I’ve already tried stripping out the space characters (%20), but I still keep getting a 400 Bad Request when I send it.

 

Most of the url was originally copied from our backend “show query” button, so I think it should be close.

 

Thanks for the help.

 

Henry

 

 

 

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700739DB8F7D194524979AEAD480%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API

Nathan Keiter

Get rid of the extra spaces, this works: <a href="https://www.stchas.edu:443/api/content/query/&#43;contentType:Departments%20&#43;all:network*%20&#43;all:operations*%20languageId:1%20&#43;deleted:false%20&#43;live:true/orderby/modDate%20desc">https://www.stchas.edu:443/api/content/query/+contentType:Departments%20+all:network*%20+all:operations*%20languageId:1%20+deleted:false%20+live:true/orderby/modDate%20desc

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Henry Versemann
Sent: Friday, October 13, 2017 4:55 PM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API

 

I’m trying to search our departments structure for a value of “Network Operations” and after some dynamic constructing and editing of the REST API url to inquire against the final url looks like this:

 

<a href="https://www.stchas.edu:443/api/content/query/&#43;contentType:Departments%20&#43;_all:network*%20&#43;_all:operations*%20languageId:1%20&#43;deleted:false%20&#43;live:true/orderby/modDate%20desc">https://www.stchas.edu:443/api/content/query/+contentType:Departments%20+_all:network*%20+_all:operations*%20languageId:1%20+deleted:false%20+live:true/orderby/modDate%20desc

 

and I’ve already tried stripping out the space characters (%20), but I still keep getting a 400 Bad Request when I send it.

 

Most of the url was originally copied from our backend “show query” button, so I think it should be close.

 

Thanks for the help.

 

Henry

 

 

 

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700739DB8F7D194524979AEAD480%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/5a09456017ad49c3bf31f00fe87d3049%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API

Nathan Keiter

Oh, never mind that was an underscore.  The original link works for me.

 

Result:

 

{"contentlets":[{"modDate":"2015-12-09 10:07:07.012","pageTitle":"","description":"","title":"Network Operations","building":"","inode":"99ded5ed-56ec-4899-aab5-fd84d1e4b0bc","academicDepartment":false,"__DOTNAME__":"Network Operations","host":"SYSTEM_HOST","lastReview":"2015-12-09 10:07:06.995","fax":"","stInode":"765899e6-e895-4036-a4b0-546a2ad4d2fa","headline":"","slug":"network-operations","owner":"nhogan","identifier":"c3829700-3f84-4077-9743-a3463a7f5050","image":"","languageId":1,"officeHours":"","URL_MAP_FOR_CONTENT":"\/academics\/departments\/network-operations","room":"","folder":"SYSTEM_FOLDER","sortOrder":0,"modUser":"nhogan","name":"Network Operations","slugMaker":""}]}

 

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nathan Keiter
Sent: Friday, October 13, 2017 5:03 PM
To: [hidden email]
Subject: [dotcms] RE: DOTCMS REST API

 

Get rid of the extra spaces, this works: <a href="https://www.stchas.edu:443/api/content/query/&#43;contentType:Departments%20&#43;all:network*%20&#43;all:operations*%20languageId:1%20&#43;deleted:false%20&#43;live:true/orderby/modDate%20desc">https://www.stchas.edu:443/api/content/query/+contentType:Departments%20+all:network*%20+all:operations*%20languageId:1%20+deleted:false%20+live:true/orderby/modDate%20desc

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [[hidden email]] On Behalf Of Henry Versemann
Sent: Friday, October 13, 2017 4:55 PM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API

 

I’m trying to search our departments structure for a value of “Network Operations” and after some dynamic constructing and editing of the REST API url to inquire against the final url looks like this:

 

<a href="https://www.stchas.edu:443/api/content/query/&#43;contentType:Departments%20&#43;_all:network*%20&#43;_all:operations*%20languageId:1%20&#43;deleted:false%20&#43;live:true/orderby/modDate%20desc">https://www.stchas.edu:443/api/content/query/+contentType:Departments%20+_all:network*%20+_all:operations*%20languageId:1%20+deleted:false%20+live:true/orderby/modDate%20desc

 

and I’ve already tried stripping out the space characters (%20), but I still keep getting a 400 Bad Request when I send it.

 

Most of the url was originally copied from our backend “show query” button, so I think it should be close.

 

Thanks for the help.

 

Henry

 

 

 

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700739DB8F7D194524979AEAD480%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/5a09456017ad49c3bf31f00fe87d3049%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/f32c1e2739ba43489e2c222a17f4b10a%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API

Henry Versemann

OK.

I figured out that I was still trying to send the query with the POST method and I think its supposed to be using the GET method. So when I made that change then I stopped getting the 400 Bad Request, but my response back from the query didn’t seem to have any contentlets that it brought back, so I’m still puzzled about that.

 

Nathan thanks for the help.

 

Have a good weekend.

 

Henry

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nathan Keiter
Sent: Friday, October 13, 2017 4:08 PM
To: [hidden email]
Subject: [dotcms] RE: DOTCMS REST API

 

Oh, never mind that was an underscore.  The original link works for me.

 

Result:

 

{"contentlets":[{"modDate":"2015-12-09 10:07:07.012","pageTitle":"","description":"","title":"Network Operations","building":"","inode":"99ded5ed-56ec-4899-aab5-fd84d1e4b0bc","academicDepartment":false,"__DOTNAME__":"Network Operations","host":"SYSTEM_HOST","lastReview":"2015-12-09 10:07:06.995","fax":"","stInode":"765899e6-e895-4036-a4b0-546a2ad4d2fa","headline":"","slug":"network-operations","owner":"nhogan","identifier":"c3829700-3f84-4077-9743-a3463a7f5050","image":"","languageId":1,"officeHours":"","URL_MAP_FOR_CONTENT":"\/academics\/departments\/network-operations","room":"","folder":"SYSTEM_FOLDER","sortOrder":0,"modUser":"nhogan","name":"Network Operations","slugMaker":""}]}

 

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [[hidden email]] On Behalf Of Nathan Keiter
Sent: Friday, October 13, 2017 5:03 PM
To: [hidden email]
Subject: [dotcms] RE: DOTCMS REST API

 

Get rid of the extra spaces, this works: <a href="https://www.stchas.edu:443/api/content/query/&#43;contentType:Departments%20&#43;all:network*%20&#43;all:operations*%20languageId:1%20&#43;deleted:false%20&#43;live:true/orderby/modDate%20desc">https://www.stchas.edu:443/api/content/query/+contentType:Departments%20+all:network*%20+all:operations*%20languageId:1%20+deleted:false%20+live:true/orderby/modDate%20desc

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [[hidden email]] On Behalf Of Henry Versemann
Sent: Friday, October 13, 2017 4:55 PM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API

 

I’m trying to search our departments structure for a value of “Network Operations” and after some dynamic constructing and editing of the REST API url to inquire against the final url looks like this:

 

<a href="https://www.stchas.edu:443/api/content/query/&#43;contentType:Departments%20&#43;_all:network*%20&#43;_all:operations*%20languageId:1%20&#43;deleted:false%20&#43;live:true/orderby/modDate%20desc">https://www.stchas.edu:443/api/content/query/+contentType:Departments%20+_all:network*%20+_all:operations*%20languageId:1%20+deleted:false%20+live:true/orderby/modDate%20desc

 

and I’ve already tried stripping out the space characters (%20), but I still keep getting a 400 Bad Request when I send it.

 

Most of the url was originally copied from our backend “show query” button, so I think it should be close.

 

Thanks for the help.

 

Henry

 

 

 

 

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700739DB8F7D194524979AEAD480%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/5a09456017ad49c3bf31f00fe87d3049%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/f32c1e2739ba43489e2c222a17f4b10a%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB17002E63DD70BC86A6538587AD480%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.