cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1058
Views
0
Helpful
3
Replies

CPO 3.0 Calling a REST API

Ayaz Ahmed
Beginner
Beginner

I am trying to invoke a remote REST API that returns a JSON Object.

From Browser the API Call looks like this

http://ipam-dev/phpipam/api/?app_id=api&controller=sections&action=read&id=6

Returns

{"success":true,"data":{"id":"6","name":"Telford Subnets","description":"","masterSection":"0","permissions":"{\"4\":\"1\"}","strictMode":"1","subnetOrdering":null,"order":null,"editDate":null,"showVLAN":"0","showVRF":"0"}} 

When I try it to use the CPO activity Web HTTP Request it fails with the following error

Cannot send a content-body with this verb-type.

I think the issue here is the content type. The default value is application/xml; charset=utf-8 in the activity, I tried changing it to text, html and json but still did not work. I cannot leave the content type emty either in the activity.

Does anyone has any suggestion how to make a REST call from CPO using the activity Web HTTP Request

1 Accepted Solution

Accepted Solutions

meisenst
Enthusiast
Enthusiast

Try changing GET to POST (in the CPO_REST-CALL-RQ.png screen).  Sending body content usually requires a POST not a GET.

View solution in original post

3 Replies 3

meisenst
Enthusiast
Enthusiast

Try changing GET to POST (in the CPO_REST-CALL-RQ.png screen).  Sending body content usually requires a POST not a GET.