I’m trying to add Jobber’s API (getjobber.com) to my bubble app using the API Connector. This is my first API i’ve tried integrating. From what I can tell is Jobber uses GraphQL and OAuth2 for its API. Here are the docs from jobber (https://developer.getjobber.com/docs)
I think I’ve been able to get an access token and refresh token. When I try to retrieve data using the POST I get the following response:
{
"data": null,
"errors": [
{
"message": "The field clients on an object of type Query was hidden due to permissions",
"locations": [
{
"line": 1,
"column": 9
}
],
"path": [
"clients"
]
}
]
}
–
Here is the query that I entered and works in the GraphiQL on Jobber:
{“query”: “query { clients { totalCount } }”}
Please help! I’m losing my mind trying to figure out what is wrong. Appreciate any direction you guys can provide.
I’m afraid I’m stuck in the same spot. API Connector looks good on the OAuth Post Call. I am Initializing the first call and receiving an access_token in return. I am pasting that access_token in my Value settings for the Authorization header, prepending with 'Bearer ’
When I run JSON query, I am getting a 500 Internal Server Error
Bubble doesn’t work very well with graphQL, it’s really frustrating. I’ve had success by (depending on API):
Adding the header Content-Type: application/graphql which more or less let’s you write queries as normal where it works
Failing that, instead change that header to Content-Type: application/json then remove all newlines from your body. When using this method, you’ll have to wrap the entire query in another query as in OP’s post: {"query": "query { clients { totalCount } }"}
Note also that with the second option, since you are double wrapping the query, any special characters within the nested query will need to be escaped.
According to documentation.
If you keep new line, you will get an error because this will broke the JSON. However, this is possible to keep new line if you encode the query correctly.