[英]Jenkins/Hudson API Access with API Key Not Working
I'm trying to access my Jenkins build though the api however am unsure whether it is possible to do with a straight forward URL. 我正在尝试通过api访问我的Jenkins版本,但是不确定是否可以使用简单的URL。
I've basically built a local website in which I have something like: 我基本上已经建立了一个本地网站,其中包含以下内容:
var jsonAPI = "http://jenkinsurl.com/build/api/json"
However I need authenticated. 但是我需要认证。 So i found my API Token but how do I put it together - is it like:
所以我找到了我的API令牌,但如何将其放在一起-是这样的:
var jsonAPI = "http://jenkinsurl.com/build/api/json?apitoken=xxxxxxx"
Thanks 谢谢
API Token is basically like a password. API令牌基本上就像一个密码。 You still need to supply a username/password pair at HTTP authentication.
您仍然需要在HTTP身份验证时提供用户名/密码对。
You can try (replace apitoken
with actual token): 您可以尝试(将
apitoken
替换为实际令牌):
http://username:apitoken@jenkinsurl.com/build/api/json
or with curl: 或卷曲:
curl -u username:apitoken http://jenkinsurl.com/build/api/json
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.