I am working on creating a custom app for jobber in make
I am getting this error:
- The field clientCreate on an object of type Mutation was hidden due to permissions
{
“url”: “https://api.getjobber.com/api/graphql”,
“method”: “POST”,
“headers”: {
“X-JOBBER-GRAPHQL-VERSION”: “2022-04-29”,
“Content-Type”: “application/json”
},
“qs”: {
“query”: “mutation clientCreate {\r\n clientCreate(\r\n input: {\r\n firstName: "{{parameters.FName}}"\r\n lastName: "{{parameters.LName}}"\r\n emails: [\r\n { description: MAIN, primary: true, address: "{{parameters.email}}" }\r\n ]\r\n billingAddress: {\r\n street1: "{{parameters.street}}"\r\n city: "{{parameters.city}}"\r\n country: "{{parameters.country}}"\r\n postalCode: "{{parameters.postalCode}}"\r\n }\r\n companyName: "{{parameters.company}}"\r\n phones: [\r\n { description: MAIN, primary: true, number: "{{parameters.phone}}" }\r\n ]\r\n }\r\n ) {\r\n client {\r\n id\r\n firstName\r\n lastName\r\n billingAddress {\r\n street1\r\n city\r\n country\r\n postalCode\r\n }\r\n companyName\r\n emails {\r\n description\r\n primary\r\n address\r\n }\r\n isLead\r\n phones {\r\n description\r\n primary\r\n number\r\n }\r\n }\r\n userErrors {\r\n message\r\n path\r\n }\r\n }\r\n}”
},
“response”: {
“output”: “{{body}}”
}
}
1 Like
samliew
3
Are there any settings in Jobber UI/dashboard that disallows creating a new client?
If it’s using an OAuth connection, does the OAuth connection request for the “create client” scope?
2 Likes
In jobber The scopes are given while creating the app itself
1 Like
Also it was being created when I was manually passing access token
samliew
6
Did you authorise the OAuth connection with a Jobber admin account, or an account with write access to “create client”?
2 Likes
Yes I did that
{
“authorize”: {
“url”: “https://api.getjobber.com/api/oauth/authorize”,
“qs”: {
“client_id”: “{{ifempty(parameters.clientId, common.clientId)}}”,
“redirect_uri”: “{{oauth.redirectUri}}”,
“response_type”: “code”
},
“response”: {
“temp”: {
“code”: “{{query.code}}”
}
}
},
"token": {
"url": "https://api.getjobber.com/oauth/token",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"code": "{{temp.code}}",
"client_id": "{{ifempty(parameters.clientId, common.clientId)}}",
"grant_type": "authorization_code",
"redirect_uri": "{{oauth.redirectUri}}",
"client_secret": "{{ifempty(parameters.clientSecret, common.clientSecret)}}"
},
"response": {
"data": {
"accessToken": "{{body.refresh_token}}"
}
},
"log": {
"sanitize": [
"request.body.code",
"request.body.client_secret"
]
},
"SecondToken": {
"url": "https://api.getjobber.com/oauth/token",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"code": "{{temp.code}}",
"client_id": "{{ifempty(parameters.clientId, common.clientId)}}",
"grant_type": "refresh_token",
"client_secret": "{{ifempty(parameters.clientSecret, common.clientSecret)}}"
},
"response": {
"data": {
"accessToken": "{{body.access_token}}"
}
},
"log": {
"sanitize": [
"request.body.code",
"request.body.client_secret"
]
}
}
}}
This is my auth script
1 Like