• Resolved fnitemshop

    (@fnitemshop)


    Trying to use the following API with a valid key but I get the following message:

    DEBUG: Cache is NOT active
    DEBUG: try to retieve this url: https://fortnite-public-api.theapinetwork.com/prod09/store/get
    DEBUG: wp_remote_get to https://fortnite-public-api.theapinetwork.com/prod09/store/get
    DEBUG: arguments: Array
    (
        [timeout] => 5
        [headers] => Array
            (
                [Authorization] => samplekey123
            )
    
        [sslverify] => 
    )
    
    DEBUG: success getting URL
    
    DEBUG: api-answer:
    Inspect JSON: Copypaste (click in box, Strg-A marks all, then insert into clipboard) the JSON from the following box to https://jsoneditoronline.org):
    {
        "error": true,
        "errorCode": "errors.com.fortnite.common.unknown",
        "errorMessage": "Sorry the resource you were trying to access cannot be accessed with the HTTP method you used.",
        "numericErrorCode": 1009,
        "originatingService": "com.fortnite.account.public",
        "intent": "prod"
    }

    and the json data looks like this

    {"date_layout":"day-month-year","lastupdate":1537488004,"date":"21-09-18","rows":8,"vbucks":"https:\/\/fortnite-public-files.theapinetwork.com\/fortnite-vbucks-icon.png","items":[{"itemid":"b2ac28c-567719a-1a47611-c9010d3","name":"Frostwing","cost":"1500","featured":1,"refundable":1,"lastupdate":1537488004,"item":{"image":"https:\/\/fortnite-public-files.theapinetwork.com\/glider\/57c6bcc481a4c710ad0be87a9ccc1712.png","images":{"transparent":"https:\/\/fortnite-public-files.theapinetwork.com\/glider\/57c6bcc481a4c710ad0be87a9ccc1712.png","background":"https:\/\/fortnite-public-files.theapinetwork.com\/image\/b2ac28c-567719a-1a47611-c9010d3.png","featured":{"transparent":null,"background":null}},"captial":"glider","type":"glider","rarity":"legendary","obtained_type":"vbucks"}},{"itemid":"3e02f68-d00325f-44c45ee-4f9a729","name":"Valkyrie","cost":"2000","featured":1,"refundable":1,"lastupdate":1537488004,"item":{"image":"https:\/\/fortnite-public-files.theapinetwork.com\/outfit\/a6ec34572f3cc8106d53338088d899cd.png","images":{"transparent":"https:\/\/fortnite-public-files.theapinetwork.com\/outfit\/a6ec34572f3cc8106d53338088d899cd.png","background":"https:\/\/fortnite-public-files.theapinetwork.com\/image\/3e02f68-d00325f-44c45ee-4f9a729.png","featured":{"transparent":"https:\/\/fortnite-public-files.theapinetwork.com\/featured\/3e02f68-d00325f-44c45ee-4f9a729.png","background":"https:\/\/fortnite-public-files.theapinetwork.com\/image\/3e02f68-d00325f-44c45ee-4f9a729\/featured.png"}},"captial":"outfit","type":"outfit","rarity":"legendary","obtained_type":"vbucks"}},{"itemid":"7ebcbed-96a7d5b-019b204-957700e","name":"Capoeira","cost":"500","featured":0,"refundable":1,"lastupdate":1537488004,"item":{"image":"https:\/\/fortnite-public-files.theapinetwork.com\/emote\/b41e6905fc4e4aa98f6fdca06581c854.png","images":{"transparent":"https:\/\/fortnite-public-files.theapinetwork.com\/emote\/b41e6905fc4e4aa98f6fdca06581c854.png","background":"https:\/\/fortnite-public-files.theapinetwork.com\/image\/7ebcbed-96a7d5b-019b204-957700e.png","featured":{"transparent":null,"background":null}},"captial":"emote","type":"emote","rarity":"rare","obtained_type":"vbucks"}},{"itemid":"ff624e6-60edf93-d2a9035-6dc487b","name":"Battle Pass Tiers","cost":"900","featured":0,"refundable":0,"lastupdate":1537488004,"item":{"image":"https:\/\/fortnite-public-files.theapinetwork.com\/misc\/29a49aaf4b74ce171593c3e7046b9f13.png","images":{"transparent":"https:\/\/fortnite-public-files.theapinetwork.com\/misc\/29a49aaf4b74ce171593c3e7046b9f13.png","background":"https:\/\/fortnite-public-files.theapinetwork.com\/image\/ff624e6-60edf93-d2a9035-6dc487b.png","featured":{"transparent":null,"background":null}},"captial":"misc","type":"misc","rarity":"epic","obtained_type":"vbucks"}},{"itemid":"4a01aa4-70df324-0678838-f191df0","name":"Bunny Brawler","cost":"1200","featured":0,"refundable":1,"lastupdate":1537488004,"item":{"image":"https:\/\/fortnite-public-files.theapinetwork.com\/outfit\/8002466ac5bf5b24336fd9c966aa09fb.png","images":{"transparent":"https:\/\/fortnite-public-files.theapinetwork.com\/outfit\/8002466ac5bf5b24336fd9c966aa09fb.png","background":"https:\/\/fortnite-public-files.theapinetwork.com\/image\/4a01aa4-70df324-0678838-f191df0.png","featured":{"transparent":null,"background":null}},"captial":"outfit","type":"outfit","rarity":"epic","obtained_type":"vbucks"}},{"itemid":"3be2c7b-f65d0f3-ac50092-83d2017","name":"Tactical Spade","cost":"500","featured":0,"refundable":1,"lastupdate":1537488004,"item":{"image":"https:\/\/fortnite-public-files.theapinetwork.com\/pickaxe\/b2cb2eae1820e68af654253959e0a4a2.png","images":{"transparent":"https:\/\/fortnite-public-files.theapinetwork.com\/pickaxe\/b2cb2eae1820e68af654253959e0a4a2.png","background":"https:\/\/fortnite-public-files.theapinetwork.com\/image\/3be2c7b-f65d0f3-ac50092-83d2017.png","featured":{"transparent":null,"background":null}},"captial":"pickaxe","type":"pickaxe","rarity":"uncommon","obtained_type":"vbucks"}},{"itemid":"1a597ea-432a9d2-87db6e9-8067e3b","name":"Shake It Up","cost":"800","featured":0,"refundable":1,"lastupdate":1537488004,"item":{"image":"https:\/\/fortnite-public-files.theapinetwork.com\/emote\/3211f6e57f3c52f437ee5c0f88185c63.png","images":{"transparent":"https:\/\/fortnite-public-files.theapinetwork.com\/emote\/3211f6e57f3c52f437ee5c0f88185c63.png","background":"https:\/\/fortnite-public-files.theapinetwork.com\/image\/1a597ea-432a9d2-87db6e9-8067e3b.png","featured":{"transparent":null,"background":null}},"captial":"emote","type":"emote","rarity":"epic","obtained_type":"vbucks"}},{"itemid":"0894dcb-d7753fa-a475d45-a340b46","name":"Tower Recon Specialist","cost":"800","featured":0,"refundable":1,"lastupdate":1537488004,"item":{"image":"https:\/\/fortnite-public-files.theapinetwork.com\/outfit\/d6b58cd4543845d4f1f9499c033cb94f.png","images":{"transparent":"https:\/\/fortnite-public-files.theapinetwork.com\/outfit\/d6b58cd4543845d4f1f9499c033cb94f.png","background":"https:\/\/fortnite-public-files.theapinetwork.com\/image\/0894dcb-d7753fa-a475d45-a340b46.png","featured":{"transparent":null,"background":null}},"captial":"outfit","type":"outfit","rarity":"uncommon","obtained_type":"vbucks"}}]}

    • This topic was modified 7 years, 9 months ago by fnitemshop.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author berkux

    (@berkux)

    Hi,

    the error message is “Sorry the resource you were trying to access cannot be accessed with the HTTP method you used.”.
    I’m not familiar with this API, but this sounds that you might need POST instead of GET as method.
    But if you get JSON like the 2nd box you managed to get access.
    Is the question now how to evaluate this JSON?

    Bernhard

    Plugin Author berkux

    (@berkux)

    Hi,

    see
    https://documenter.getpostman.com/view/4499368/RWEjoGqD

    You need the pro plugin for that, the free plugn can’t do POST.

    Bernhard

    Thread Starter fnitemshop

    (@fnitemshop)

    Thank you for your help and your awesome plugin, I got it to work with POST. (https://fnitemshop.com/test1/).

    I have two questions though about further implementation. My first question if it is possible to display an array object depending on the value of whether the value of item[0].featured is 0 or 1. I tried it with requiredfieldsandvalues=”featured=0″ but that had no effect.

    My second question is regarding formatting, currently it displays it as a single column is it possible to have for example 2 or 3. (Kinda like my frontpage now which has 2 columns so on desktop space is used more efficient)

    Thank you.

    [jsoncontentimporterpro url="https://fortnite-public-api.theapinetwork.com/prod09/store/get" method="post" header=Authorization:xxxx parser=twig requiredfieldsandvalues="featured=0"]
    <h3>Featured Items</h3>
    {% for fn in items %}
    
    {{fn.name}} {{fn.cost}}
    
    <img src="{{fn.item.images.background}}" width="300" height="300" />
    
    {% endfor %}
    <div></div>
    [/jsoncontentimporterpro]
    • This reply was modified 7 years, 9 months ago by fnitemshop.
    Plugin Author berkux

    (@berkux)

    Hi,

    as this is a pro question switch to this support, please:
    https://jsoncontentimporter.freshdesk.com/widgets/feedback_widget/new?searchArea=no

    To write something worth it anyway, try this:

    [jsoncontentimporterpro url=http://api.json-content-importer.com/extra/json/fortnite.json parser=twig]
    lastupdate: {{lastupdate}}
    {% for i in items if i.featured==0 %}
    {{i.name}}: {{i.featured}}
    <img src={{i.item.image}} width=30>
    <hr>{% endfor %}
    [/jsoncontentimporterpro]
    Thread Starter fnitemshop

    (@fnitemshop)

    Thank you that worked!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Json data doesn’t show’ is closed to new replies.