用于发布到 JMP Live/Public 的 API 密钥我记得在最近的一次 JMP Live 通话中,有人解释说我们需要在 JSL 中包含 API 密钥才能发布到 JMP Live/Public。 有人有这方面的详细信息吗? 我已经经历过自动发布 JMP Live 报告的 10 个有用技巧但 API 密钥尚未包含在这些说明中。
另外,是否有办法将发布定向到 JMP Live 或 Public? 目标似乎已硬连线到 JSL 的设置中。
回复:发布到 JMP Live/Public 的 API 密钥有用的帖子! 还有两个问题:
1. 您包含的凭据文件一般是什么样子?
2. 当我只想更新数据表时,添加 API Key 似乎不起作用。 它也不喜欢我在搜索帖子时得到的 package-id 并使用返回的 ID。 有相关的示例脚本吗?
多谢
回复:发布到 JMP Live/Public 的 API 密钥感谢您的这些,他们都提供了帮助,因此已标记为共同解决方案!
现在只是处理发布到 JMP Live 和 Public 的奇怪超时情况。
回复:发布到 JMP Live/Public 的 API 密钥同样,我做了类似的事情:
url = "";
user = "";
api_key = "";
title = "My Report";
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dis = dt << Run Script( "Distribution" );
biv = dt << Run Script( "Bivariate" );
webrpt = New Web Report();
webrpt << Add Reports( {dis, biv} );
url = webrpt << Publish(
URL( url ),
Username( user ),
Prompt( IfNeeded ),
Title( title ),
API Key(api_key)
);
If(url != "",
web(url);
)
Ryan 有提示(从不),这是默认设置,但是,我使用提示(如果需要),因为我无法在第一次就得到正确的脚本。 如果您要发布到 JMP 15.1 (15.2) 或 16 JMP Live,ifNeeded 将提示您使用 15.1(及更高版本)的新身份验证输入凭据。 请记住,您无法从 JMP 15(15.1、15.2)发布到 JMP 16(反之亦然)
第一次发布将安全地保存您的令牌(用户和 url),该令牌与安全的用户/密码不同。 或者,您可以使用 JMP Live Connect 来存储您的令牌。此外,如果您不想将 api_key 添加到发布命令,JMP Live Connect 可以保存它。
API 密钥是从您的 JMP Live 服务器用户配置文件中获取的。 有一个“生成 API 密钥”。 如果生成一个,它将生成一个新的。 这意味着旧的将不再起作用。 您需要保存 API 密钥以供将来在该服务器上使用。
API 密钥对于用户和发布 URL 来说是唯一的。 也就是说,来自 jmplivesales 的密钥不适用于 devlive15,或者适用于 sasbeb 的密钥不适用于 Bryan.Boone@jmp.com
回复:发布到 JMP Live/Public 的 API 密钥以下是我用于发布到 JMP Live 的代码,其中包含 API 密钥参数。 为 URL 参数指定的值用于将发布定向到适当的 JMP Live 实例。
Names Default To Here( 1 );
Include( "JMPLiveCredentials.jsl" );
JMPLive = New Namespace(
"JMPLive"
);
JMPLive:Initialize() = Function( {},
{},
JMPLive:key = Credentials:key;
JMPLive:server = Credentials:server;
);
JMPLive:Publish Report = Function( {web_report, package_id = Empty()},
publishExpr = Expr(
Publish(
Prompt( Never ),
URL( JMPLive:server ),
API key( JMPLive:key ),
Public( 0 ),
Publish Data( 1 )
)
);
If( !Is Empty( package_id ),
Insert Into( publishExpr, Expr( Replace( package_id, Prompt( Never ) ) ) )
);
Eval( Substitute( Expr( web_report << publishMessage ), Expr( publishMessage ), Name Expr( publishExpr ) ) );
);
JMPLive:Initialize();
然后执行类似于以下内容的操作:
report = New Web Report();
report << Add Report(
Community_Graphs:Create Graph of Actions(),
Title( "JMP Community - Actions" ),
Description( "Displays the actions taken by users" )
);
// To replace a report
JMPLive:Publish Report( report, "zsa8Hypq021n" );
// To create a new report
JMPLive:Publish Report( report );
希望有帮助。