shareCardWithPerson [Invalid type: expected NUMBER. (Expected non-null value)]

NateBI
Contributor

POSTMAN:
ACCESS_TOKEN obtained:
POST: https://api.domo.com/oauth/token data = {
"grant_type": "client_credentials",
"scope": "data" # "data dashboard workflow user"
}, auth = {CLIENT_ID,CLIENT_SECRET}
CodeEngine Called:
POST: url: https://company.domo.com/api/codeengine/v2/packages/35233147-8c17-420d-8f48-2754ae6108ea/versions/3.0.1/functions/shareCardWithPerson headers = {
"X-DOMO-Developer-Token": access_token,
"Content-Type": "application/json"
} body = {
"inputVariables": {
"person": 994139312,
"card_id": 908077640
},
"settings": { "getLogs": true
}
}
Error:
{
"status": 401,
"statusReason": "Unauthorized",
"path": "/api/codeengine/v2/packages/35233147-8c17-420d-8f48-2754ae6108ea/versions/3.0.1/functions/shareCardWithPerson",
"message": "Full authentication is required to access this resource",
"toe": "REDACTED"
}
I have used the sendEmail function just fine simply using the access_token generated from Domo admin. This token didn't work so I read I needed to generate one using the method explained above, however this also hasn't worked.
Tagged:
0
Best Answer
-
[MAD LAUGHING] It was the cardId variable incorrectly spelt.
1
Answers
-
Watched this:
https://www.youtube.com/watch?v=Qy0aXeJWSlI
Testing with original access key but in the headers not bearer token.
new error message:{
"status": 400,
"statusReason": "Bad Request",
"message": "The following input values are invalid: [Invalid type: expected NUMBER. (Expected non-null value)]",
"toe": "1RG8QZY4X2-12V69-681TW"real values removed but this is the body:
{
"inputVariables": {
"person": 000000,
"card_id": 0000000
},
"settings": { "getLogs": true
}
}I've also tried a list input for person and a string input for card_id based on error message.
Original js function:
/**
* Shares a card with a specific person
*
* @param {Person} person - The person
* @param {text} cardId - The ID of the card
* @returns {boolean}
*/
function shareCardWithPerson(person, cardId) {
return shareResource('badge', cardId, 'user', person);
}0 -
[MAD LAUGHING] It was the cardId variable incorrectly spelt.
1
Categories
- All Categories
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 306 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3K Transform
- 112 SQL DataFlows
- 649 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 787 Beast Mode
- 78 App Studio
- 43 Variables
- 742 Automate
- 187 Apps
- 474 APIs & Domo Developer
- 67 Workflows
- 14 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 406 Distribute
- 117 Domo Everywhere
- 279 Scheduled Reports
- 10 Software Integrations
- 139 Manage
- 136 Governance & Security
- 8 Domo Community Gallery
- 44 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 113 Community Announcements
- 4.8K Archive