Skip to content

POST API to Verint, the connection is not getting authorised #489

@nasliya

Description

@nasliya

Hi All,

I am trying to POST the data using generic CSI API of Verint( Workforce Mnagement Tool) using API Key and Value. Unfortunately, the connection si not getting established. When executed the code using postman , the POST Request got succedded because there isa documentation with some prerequisite script in postman. Can someone help in fixing the below code.

Python Code 👍

import requests

api_key = "xxxxxxxx"
api_value = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Set up the headers with the API key and value

headers = {
"Content-Type": "application/json",
"X-Api-Key": api_key,
"X-Api-Value": api_value
}

data

data = {
"data": {
"type": "queueHistoryTimeSeries",
"id": 1,
"attributes": {
"queueTimeSeries": {
"dataSourceName": "AZ_Services_Datasource",
"queueName": "AZS_Test2",
"time": "2023-01-07T08:00:00.000-0700",
"reportInterval": 30,
"dataSourceGroupTimeSeries": [
{
"dataSourceGroupName": "TestG2",
"volumeActual": 80,
"volumeHandledActual": 90,
"averageSpeedToAnswerActual": 90,
"activityHandlingTimeActual": 120,
"serviceLevelActual": 50,
"abandonsActual": 90,
"backlogActual": 90,
"occupancyActual": 90,
"staffingActual": 90
}
]
}
}
}
}

Set up the endpoint URL

url = "http://xxxxxxxxxxxxxxxxxx/timeSeriesData"

Send a GET request to the endpoint with the headers

response = requests.post(url, headers=headers,data=data)
print(response.request.url)
print(response.request.headers)
print(response.request.body)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions