Skip to main content
Answered

Why won't my API call to create an export job work?


I'm trying to use the api to create an export job. I'm using ver 2.2. Getting a response of "Requested resource is not available in current API version" when posting to https://api.intercom.io/export/messages/data?created_at_after=1596240000&created_at_before=1599586872

I confirmed the api key is working by doing a contact call and got the expected result. This is my first time using Intercom, so if someone can shed some light for me here it would be most appreciated.

Best answer by Roy

@ken wny IRE​, I just found a solution here, it's working form Unstable version.

 

All you need to do is change the API version from the developer Hub.

intercom-unstable

 

 

 

Response:

jobintercom

 

 

 

Let me know if this works

View original
Did this topic help you find an answer to your question?

21 replies

Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • September 8, 2020

Sorry for the previews reply, I just now tested it and seems there some problems with API. :/


  • Author
  • Active User
  • 10 replies
  • September 8, 2020

Ah, ok. Any idea of timeframe to fix? Just so I can let my boss know.


  • Author
  • Active User
  • 10 replies
  • September 8, 2020

Thanks for the reply, and sorry for the assumption with my other reply-for some reason I assumed you worked for the company, but as I thought about it I realize you’re probably another user trying to help me. Either way – thanks. 😊


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • Answer
  • September 8, 2020

@ken wny IRE​, I just found a solution here, it's working form Unstable version.

 

All you need to do is change the API version from the developer Hub.

intercom-unstable

 

 

 

Response:

jobintercom

 

 

 

Let me know if this works


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • September 8, 2020

@ken wny IRE​ , it definitely works from an Unstable version.

intercom-response

 

It means that there really some issues with the current API, hope the Intercom team reading this and fix it - @eric f11​ .


  • Author
  • Active User
  • 10 replies
  • September 8, 2020

Great! I will try that tomorrow. Thank you very much!


Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • September 9, 2020

Hey @roy s11​, thanks so much for flagging this with me! I'm following up with the team responsible for our API internally 👍


Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • September 9, 2020

So, for now, it's expected behaviour that this is only available with the Unstable version. I've asked the team which manages our Developer Docs to update this to make it super clear that this is only available in the Unstable version - looks like this was forking off into the version 2.2 docs by accident!


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • September 9, 2020

Thank you @eric f11​  🙏


  • Author
  • Active User
  • 10 replies
  • September 9, 2020

Eric, Thanks for clarifying this. Can you tell me how to access the unstable version via api call using the Intercom-Version header?


  • Author
  • Active User
  • 10 replies
  • September 9, 2020

Well... I changed the version to unstable, and it seems that it really is unstable because now I am getting a 500 server error in response...  @eric f11 


Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • September 9, 2020

Hey @ken wny IRE​, are you still getting 500 responses? We had a brief outage earlier.


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • September 9, 2020

@ken wny IRE​ , Intercom-Version: Unstable


  • Author
  • Active User
  • 10 replies
  • September 9, 2020

Oh that explains it. No, now I'm getting a response saying that I need to include created_at_after and created_at_before fields, but I am sending those...


  • Author
  • Active User
  • 10 replies
  • September 9, 2020

The body of my request has this json:

{

"created_at_after": 1596240000,

"created_at_before": 1599586872

}


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • September 9, 2020

Request:

{

 "created_at_after": 1527811200,

 "created_at_before": 1530316800

}

 

Response:

{

  "job_identifier": "*Hidden*",

  "status": "pending",

  "download_url": "",

  "download_expires_at": ""

}

 

It's working


  • Author
  • Active User
  • 10 replies
  • September 9, 2020

Maybe this will help. Can you see if I am missing something here?

 

Here is my console info:

 

Accept: application/json

Content-Type: application/json

Authorization: Bearer my_token

Postman-Token: postman_token

Host: api.intercom.io

▶️

Request Body

{

"created_at_after": 1596240000,

"created_at_before": 1599586872

}

▶️

Response Headers

Date: Wed, 09 Sep 2020 19:11:39 GMT

Content-Type: application/json; charset=utf-8

Transfer-Encoding: chunked

Connection: keep-alive

Status: 400 Bad Request

Cache-Control: no-cache

X-RateLimit-Limit: 500

X-RateLimit-Reset: 1599678700

Strict-Transport-Security: max-age=31556952; includeSubDomains; preload

X-RateLimit-Remaining: 500

X-Intercom-Version: b763308b151c2e83df4dfc6654877de0c37445ec

Vary: Accept-Encoding

X-XSS-Protection: 1; mode=block

X-Request-Id: 0001rgseqie2v780v7eg

Intercom-Version: Unstable

X-Runtime: 0.057656

X-Frame-Options: SAMEORIGIN

X-Content-Type-Options: nosniff

 

▶️

Response Body

{"type":"error.list","request_id":null,"errors":[{"code":"bad_request","message":"'created_at_after' is a required parameter"},{"code":"bad_request","message":"'created_at_before' is a required parameter"}]}

 


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • September 9, 2020

  • Author
  • Active User
  • 10 replies
  • September 9, 2020

I am. It's responding with

{

"type": "error.list",

"request_id": null,

"errors": [

{

"code": "bad_request",

"message": "'created_at_after' is a required parameter"

},

{

"code": "bad_request",

"message": "'created_at_before' is a required parameter"

}

]

}


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • September 9, 2020

@ken wny IRE​ , Please take a look to Postman configuration.

 

postman-1

postman-2

postman-3

curl-code


  • Author
  • Active User
  • 10 replies
  • September 10, 2020

Thank you for posting those screen shots. I found the problem. I was not sending Content-Length, and apparently, that is what was missing. So now it works in Postman, but I still have to figure out how to send that header in my php code using Guzzle, because that is still not working. Apparently the server does not like it when that header is missing....

 

Edit: The reason my code was not working right was because I wasn't sending a timestamp, but a string. I didn't have to send the Content-Length header in my code, so my conclusion is that Postman requires that header -without it, it must not send any content, which would explain why the server was asking for those variables, because postman never actually sent them!

 

 

Thank you for all your help! I really appreciate it!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings