cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
482
Views
1
Helpful
3
Replies

Is there a way to pull header information from CVP REST Element

chad_meyer
Level 1
Level 1

I have a CVP 12.5 application that is performing an API POST.  While I am able to retrieve the contents via element data I now have a need to utilize one of the headers that is also returned.  I do not see a way to pull in any header information.  Any help would be appreciated.

3 Replies 3

macroarchie
Level 1
Level 1

Yes, it is possible to retrieve header information from a CVP REST Element response.

When you make a REST API request to CVP, the response typically includes HTTP headers that contain metadata about the response. You can retrieve this header information by accessing the response object in your code.

In most programming languages, you can access the HTTP headers of a REST API response by looking at the response headers object. For example, in Python, you can use the headers attribute of the response object returned by the requests library.

Best,

Accedii

While I have done this very thing in Python and the requests module I would like to do this natively within my CVP application.  Also, to clarify this is the REST element within CallStudio, not the CVP APIs themselves.

ptindall
Cisco Employee
Cisco Employee

Unfortunately, response headers are not exposed by the out-the-box HTTP client element so you'll have to resort to a custom one.  You could build from scratch, try extending the element class for the out-the-box element or it might be quicker to repurpose an existing example.   There's an Agent Request API example here that includes a POST request and extraction of Location header into element data.  https://app.box.com/s/zl635ootbybqgmjo2m2y8v9w3h18yd9e