Hallo,
da es das erste mal für mich ist, dass ich mich mit API's beschäftige und nach langem Suchen nicht auf die Lösung gekommen bin, brauche ich eure Hilfe. Vielleicht kennt sich damit ja jemand aus.
Ich würde gerne eine API auf meiner Website einfügen, die API läuft mit Json, durch Web Tokens.
Gegeben ist:
Mein API Token:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiIsImtpZCI6IjI4YTMxOGY3LTAwMDAtYTFlYi03ZmExLTJjNzQzM2M2Y2NhNSJ9.eyJpc3MiOiJzdXBlcmNlbGwiLCJhdWQiOiJzdXBlcmNlbGw6Z2FtZWFwaSIsImp0aSI6IjQ4MjdkZGIxLTY3NTMtNDdjYy05YmJlLTE2ODkzZTQ2MTEyMCIsImlhdCI6MTQ1NDUzMjkwNiwic3ViIjoiZGV2ZWxvcGVyL2E0Mjc0YmEwLTZjZTYtNTEyNS02MjIxLTliM2Y1YTcxNzcxZiIsInNjb3BlcyI6WyJjbGFzaCJdLCJsaW1pdHMiOlt7InRpZXIiOiJkZXZlbG9wZXIvc2lsdmVyIiwidHlwZSI6InRocm90dGxpbmcifSx7ImNpZHJzIjpbIjgzLjE3NS44OS4zNCJdLCJ0eXBlIjoiY2xpZW50In1dfQ.aD0y4WRpwfRowwkLrkfEMsL1fI0RWTEg6HhoXrUzZEll7qeSBw3D8eRR5f3sO1iqM1FiPfE2XmqhHxgcmz3qoA
Curl
curl -X GET --header "Accept: application/json" --header "authorization: Bearer <API token>" "https://api.clashofclans.com/v1/clans/%23LL8RGRUY"
Request URL
Response Body (Der ist vom jetzigen Stand, dh. relativ unnötig, jedoch sollte soetwas nur auf aktuellem Stand zurückgegeben werden und somit auf der Website ausgegeben werden)
{
"tag": "#LL8RGRUY",
"name": "ScareUs",
"type": "inviteOnly",
"description": "Willkommen bei ScareUs :) Anforderungen: Mind. Lvl 30! Mind. RH 5, möglichst guter Ausbau des Dorfes! Bereitschaft zu spenden! Geistige Reife! Cw beide Angriffe Pflicht! Bewerbt euch mit 1-2 Sätzen :-) Gegründet 10/2015",
"location": {
"id": 32000094,
"name": "Germany",
"isCountry": true,
"countryCode": "DE"
},
"badgeUrls": {
"small": "https://api-assets.clashofclans.com/badges/70/Ske4gpTWf8ipdLxT91hT87O0kAQBEvrLAv4CKks-XbE.png",
"large": "https://api-assets.clashofclans.com/badges/512/Ske4gpTWf8ipdLxT91hT87O0kAQBEvrLAv4CKks-XbE.png",
"medium": "https://api-assets.clashofclans.com/badges/200/Ske4gpTWf8ipdLxT91hT87O0kAQBEvrLAv4CKks-XbE.png"
},
"warFrequency": "always",
"clanLevel": 2,
"warWins": 4,
"clanPoints": 7570,
"requiredTrophies": 800,
"members": 12,
"memberList": [
{
"name": "King Nothing",
"role": "member",
"expLevel": 98,
"league": {
"id": 29000010,
"name": "Crystal League III",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/Hyqco7bHh0Q81xB8mSF_ZhjKnKcTmJ9QEq9QGlsxiKE.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/Hyqco7bHh0Q81xB8mSF_ZhjKnKcTmJ9QEq9QGlsxiKE.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/Hyqco7bHh0Q81xB8mSF_ZhjKnKcTmJ9QEq9QGlsxiKE.png"
}
},
"trophies": 2160,
"clanRank": 1,
"previousClanRank": 1,
"donations": 285,
"donationsReceived": 88
},
{
"name": "Fresh LP",
"role": "member",
"expLevel": 91,
"league": {
"id": 29000009,
"name": "Gold League I",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/CorhMY9ZmQvqXTZ4VYVuUgPNGSHsO0cEXEL5WYRmB2Y.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/CorhMY9ZmQvqXTZ4VYVuUgPNGSHsO0cEXEL5WYRmB2Y.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/CorhMY9ZmQvqXTZ4VYVuUgPNGSHsO0cEXEL5WYRmB2Y.png"
}
},
"trophies": 1869,
"clanRank": 2,
"previousClanRank": 2,
"donations": 525,
"donationsReceived": 37
},
{
"name": "Druli",
"role": "coLeader",
"expLevel": 68,
"league": {
"id": 29000007,
"name": "Gold League III",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png"
}
},
"trophies": 1579,
"clanRank": 3,
"previousClanRank": 3,
"donations": 333,
"donationsReceived": 156
},
{
"name": "Pre",
"role": "coLeader",
"expLevel": 73,
"league": {
"id": 29000007,
"name": "Gold League III",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png"
}
},
"trophies": 1474,
"clanRank": 4,
"previousClanRank": 4,
"donations": 1612,
"donationsReceived": 1328
},
{
"name": "ScareMe",
"role": "leader",
"expLevel": 56,
"league": {
"id": 29000007,
"name": "Gold League III",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png"
}
},
"trophies": 1423,
"clanRank": 5,
"previousClanRank": 5,
"donations": 925,
"donationsReceived": 797
},
{
"name": "nadilicous",
"role": "coLeader",
"expLevel": 71,
"league": {
"id": 29000007,
"name": "Gold League III",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/vd4Lhz5b2I1P0cLH25B6q63JN3Wt1j2NTMhOYpMPQ4M.png"
}
},
"trophies": 1337,
"clanRank": 6,
"previousClanRank": 6,
"donations": 678,
"donationsReceived": 1142
},
{
"name": "☆byDennis☆",
"role": "member",
"expLevel": 58,
"league": {
"id": 29000006,
"name": "Silver League I",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/nvrBLvCK10elRHmD1g9w5UU1flDRMhYAojMB2UbYfPs.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/nvrBLvCK10elRHmD1g9w5UU1flDRMhYAojMB2UbYfPs.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/nvrBLvCK10elRHmD1g9w5UU1flDRMhYAojMB2UbYfPs.png"
}
},
"trophies": 1282,
"clanRank": 7,
"previousClanRank": 7,
"donations": 5,
"donationsReceived": 0
},
{
"name": "cev",
"role": "member",
"expLevel": 36,
"league": {
"id": 29000005,
"name": "Silver League II",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png"
}
},
"trophies": 1163,
"clanRank": 8,
"previousClanRank": 8,
"donations": 35,
"donationsReceived": 85
},
{
"name": "limedition",
"role": "admin",
"expLevel": 42,
"league": {
"id": 29000005,
"name": "Silver League II",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png"
}
},
"trophies": 1080,
"clanRank": 9,
"previousClanRank": 9,
"donations": 90,
"donationsReceived": 288
},
{
"name": "lexi",
"role": "member",
"expLevel": 28,
"league": {
"id": 29000005,
"name": "Silver League II",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png"
}
},
"trophies": 1038,
"clanRank": 10,
"previousClanRank": 10,
"donations": 0,
"donationsReceived": 10
},
{
"name": "Frosty",
"role": "coLeader",
"expLevel": 48,
"league": {
"id": 29000005,
"name": "Silver League II",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/8OhXcwDJkenBH2kPH73eXftFOpHHRF-b32n0yrTqC44.png"
}
},
"trophies": 1012,
"clanRank": 11,
"previousClanRank": 11,
"donations": 0,
"donationsReceived": 267
},
{
"name": "Nico",
"role": "member",
"expLevel": 7,
"league": {
"id": 29000001,
"name": "Bronze League III",
"iconUrls": {
"small": "https://api-assets.clashofclans.com/leagues/72/uUJDLEdAh7Lwf6YOHmXfNM586ZlEvMju54bTlt2u6EE.png",
"tiny": "https://api-assets.clashofclans.com/leagues/36/uUJDLEdAh7Lwf6YOHmXfNM586ZlEvMju54bTlt2u6EE.png",
"medium": "https://api-assets.clashofclans.com/leagues/288/uUJDLEdAh7Lwf6YOHmXfNM586ZlEvMju54bTlt2u6EE.png"
}
},
"trophies": 471,
"clanRank": 12,
"previousClanRank": 0,
"donations": 0,
"donationsReceived": 0
}
]
}
Alles anzeigen
Response Headers
Vielleicht kann mir jemand weiterhelfen und sagen, wie ich das Handhaben muss, dass ich an die Daten komme und ich diese dann anzeigen kann. Habe wie gesagt leider keine Erfahrung damit, darum möchte ich mich jetzt damit beschäftigen.
Liebe Grüße