Category : api

I uploaded a photo form PC using Facebook’s Graph API as mention in https://developers.facebook.com/docs/graph-api/resumable-upload-api The response form the server was: {"h": "2:::GCX1lgT2HE96k4EBABVmzuUrKpIEbugbAAAP:e:1614641018:953016678564535:106376874831684:ARY9xbszYdCO90XbXTE"} which is a "file handle". How can I publish the uploaded photo using that file handler? Sourc..

Read more

The task is to create a button fetching random breed and or fact from the following URL: https://catfact.ninja/breeds The problem is that eventhough i can fetch it in object or array form, I can not assign array values to php variables. I tried various methods, some of them are commented out cause they did not ..

Read more

I need some help with this case. I have made a function to show me datas of an api that i’ve been conected with Oauth1, but i execute this page in browser, instead of show me return of api, the return is blank Someone can help me with this plx? <?php //error_reporting(E_ERROR); // limpa o ..

Read more

When I’m using their API to create payment in php this error throws Exception when calling AccountingApi->createPayments: [400] Client error: PUT https://api.xero.com/api.xro/2.0/Payments?summarizeErrors=false resulted in a 400 Bad Request response: { "ErrorNumber": 14, "Type": "PostDataInvalidException", "Message": "JSON request body could not be read, Error (truncated…) } I don’t get in body what I made mistake. Source: ..

Read more

I am new to using JSON API in PHP. I am working with the following API. ( [id] => e20fb216-b4be-4410-b360-46b44fb19a8d [name] => User Logout [url] => https://hrtaskapi.dhwaniris.in/index.php/api/user/logout [description] => [data] => [dataOptions] => [dataMode] => [headerData] => Array ( [0] => stdClass Object ( [key] => token [value] => eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjQ3IiwidW5pcXVlX3VzZXJfaWQiOiIxMTg4IiwibmFtZSI6IkJhcm1lciBTb3V0aCBDb29yZGluYXRvciIsInVzZXJuYW1lIjoiMjA0MCIsIm1vYmlsZSI6Ijk5OTk5OTk5OTkiLCJsZXZlbF9pZCI6IjUiLCJwYXNzd29yZF9yZXNldF90b2tlbiI6bnVsbCwiZW1haWwiOiJhYmNuZ0BnbWFpbC5jb20iLCJhdXRoX2tleSI6ImQ0MWQ4Y2Q5OGYwMGIyMDRlOTgwMDk5OGVjZjg0MjdlIiwic3RhdHVzIjoiMSIsImNyZWF0ZWRfYXQiOiIwMDAwLTAwLTAwIDAwOjAwOjAwIiwidXBkYXRlZF9hdCI6IjIwMTktMTEtMDYgMDc6MTg6MDQiLCJjaGFuZ2VkX3Bhc3N3b3JkX29uY2UiOm51bGwsInVzZXJfZXJyb3JfZnJlcXVlbmN5XzEiOm51bGwsInVzZXJfZXJyb3JfZnJlcXVlbmN5XzIiOiIxOCIsInVzZXJfbGV2ZWwiOiJDbHVzdGVyIFN1cGVydmlzb3IiLCJsb2dpbl9pZCI6M30.ak3OSYopsW211SvJnzH4nNLvcj9Z4B16fR329fZbHeA [description] => [enabled] => 1 ..

Read more

I trying to make printify API auth in PHP. I have example in python, but I not getting right result. Can you explain me what I doing wrong ? Code in python import os import hmac def sha256hash(request): hash = hmac.new(os.environ[‘SECRET_TOKEN’].encode(‘utf-8’), request.data.encode(‘utf-8’), ‘sha256’) return ‘sha256=’ + hash.hexdigest() def secure_compare(a, b): return hmac.compare_digest(a, b) print(‘%r’ % ..

Read more

I’m making Custom endpoints on WordPress with woo-commerce. That API needs restriction with the only consumer’s keys of WordPress. I don’t want to use it with JWT, How we can do it without any plugin? The below code working perfectly, I need to add params of consumer keys to make it authentication. add_action( ‘rest_api_init’,’test’); function ..

Read more