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
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 310 Workbench
- 7 Cloud Amplifier
- 9 Federated
- 3K Transform
- 114 SQL DataFlows
- 654 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 798 Beast Mode
- 78 App Studio
- 44 Variables
- 757 Automate
- 188 Apps
- 480 APIs & Domo Developer
- 72 Workflows
- 17 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 408 Distribute
- 119 Domo Everywhere
- 279 Scheduled Reports
- 10 Software Integrations
- 141 Manage
- 137 Governance & Security
- 8 Domo Community Gallery
- 47 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive