Forum Discussion

WiringByron's avatar
WiringByron
Verified Community Coach
1 month ago

API / AI Instructions ?

Hey guys, I'm wondering: for anyone using different AI platforms that are connecting to your Jobber Open API. Is there any set of instructions that you're giving it that would be really helpful to make it work more rock solid, so that that API doesn't get disconnected randomly every once in a while?

A few times, I just have to talk myself through it, or I go to the Jobber Developer Center. I literally copy and paste everything possible and then give it to the AI. I've also told the AI to go to the Jobber Developer Center and just read everything. Wonder if someone's got something a little bit more slick.

2 Replies

  • jjd921's avatar
    jjd921
    Contributor 3

    Random disconnects are almost always refresh token rotation. Jobber access tokens expire fast. Each time one gets refreshed, the response includes a new refresh token and the old one stops working. If your AI tool keeps using the old one, or two things share one connection and one of them refreshes first, the other gets locked out until you reconnect.

     

    So the instruction I'd give the AI is simple. Save the new refresh token from every refresh response before making the next call, and never reuse an older one. Keep one tool per connection. Poking at the same app in GraphiQL from the Developer Center can also knock a token loose, so use a separate test app for that.

    • WiringByron's avatar
      WiringByron
      Verified Community Coach

      Hey, thanks a lot. I'm going to copy and paste this straight into Grokbot.