JoseCarlosDaSilva | 2017-01-27 13:46:51 UTC | #1
Hello, everybody!
I have a working integration between a SALESFORCE application and PURECLOUD, which was working fine for a couple of months, but it stopped to work suddenly.
After some investigation, I've figured out that I am using the API correctly, but I am still getting an error when I attempt do download the contact list file.
Below, I will summarize what I am doing. I can send details after, if necessary. To make sure that the problem is not on my code, I am using POSTMAN to perform all the tests with the same results.
I begin this flow by logging in to PURECLOUD API an getting a valid TOKEN of type BEARER.
Then, I am calling the "Get campaign progress" API call passing my PURECLOUD campaign ID using the URL below: https://api.{{environment}}/api/v2/outbound/campaigns/{{campaignId}}/progress
As a result, I am getting the contact list ID associated with the campaign. Next, I am calling the "Initiate the export of a contact list" API call passing the contact list ID using the following URL: https://api.{{environment}}/api/v2/outbound/contactlists/{{contactListId}}/export
After a few seconds, I am calling the "Get the URI of a contact list export" method using the URL below: https://api.{{environment}}/api/v2/outbound/contactlists/{{contactListId}}/export
As a result, I am getting the download URI for the contact list. For example, in my last attempt, I've got the following URI: https://public-api.us-east-1.mypurecloud.com/api/v1/downloads/49971412
Finalliy, I am issuing an HTTP GET request for that URL, including two headers, one for "Authorization" including the BEARER TOKEN and one for "Content-Type" with the value "application/json".
As my final result, I am getting a XML response telling me that my TOKEN is invalid. I am pasting the response below:
<?xml version="1.0" encoding="UTF-8"?> <Error> <Code>InvalidToken</Code> <Message>The provided token is malformed or otherwise invalid.</Message> <Token-0>FQoDYXdzEC4aDDvsnQiEqZaf4n0NziK3A4tvhanoAbc1gu/LpkiwTUIfTRatDyjXgvfD7AMM86lHZ57vdHHdtnQnUC5KS9PEQP8DxkDoMjWn8zOkwc7PXjnERkAYo MPdjO6c1DcrRTbaqM0HeuCBCqCgi5qxNQ6kO7/ra8N7HRoUgdlmQABaJevz2XPafKgT8e2F9fSuI0Apzf47ODhZQAVz5Byrmi U0ESMtOjr8HzYryCb1JgZuTCeK5QLI usYiD7txaOceUaqHyHEnSBPLsH/nkYR6ohjKqIsPybnbVz3d/zcIcBZ9SWePgawC2wsB7e2XFf2Qh/ef9X5sMSjfgOCPHNfFg63QNm EbgX94gke9OowfcN0dc08Tvy1eFgC/reihhXFgmlxVuj5NTSkaESuobSvirBICcUqbzDNuiO5KMRZDD1nTWPh6uMd1aegBxk9MUwGmlNG4iTudW3nK 9vdR8BaLdbEEHdXq4xlhBl hzd/6H4p9FQvFWdyxtMoad1gFeRVrXh/Q/JYz6XciJi pw1RHwu9zfYZe3 1WIIWqHwh/PLmkxpMzIG488VFjJFxc6xvUCVcnBGKcaNp Ys3rB4F htYCMWyfMomYitxAU=</Token-0> <RequestId>5BF022ECA93D3894</RequestId> <HostId>fmze7Qnob8IYMgU2QaHa8mTYPMGDI6OyOE0wmP7tBcz3DRslU0hMZPZFfSJr9kXck6McpGRN0b8=</HostId> </Error>
As I told you before, this flow was working fine since October/2016 and it stopped to work suddenly.
Am I doing something wrong? Did the API change and the docs weren't updated yet?
Thanks in advance for any support.
Best regards,
José Carlos da Silva.
tim.smith | 2017-01-27 15:30:41 UTC | #2
Can you provide the correlation ID from the response header? I tested this using wget and I can retrieve a file from my org successfully with wget -d --header='authorization: bearer token' https://public-api.us-east-1.mypurecloud.com/api/v1/downloads/xxxxxxxx.
system | 2017-08-28 19:31:35 UTC | #3
This post was migrated from the old Developer Forum.
ref: 853