Doubt Consume Web Service in Wordpress

Asked

Viewed 161 times

0

I have a site in wordpress, made by myself, is called School Circuit, in it I need to consume the data of a webservice for management of championships, teams, games, students, etc... The company responsible for the Web Service gave me pdf’s with an example of how to pull this data, but since I never did that, unfortunately I’m not able to call the information, please, if you could just give me an example of how to do it, I would be very grateful! Att

here’s one of my attempts, it’s all wrong

$api_request = 'https://www.sportsmanager.com.br/api/[email protected]&token=SDE78623GVS7234GNMSKLano=&status=';
    $response = wp_remote_get( $api_request ).html();
    $(function() {
    $("texte").html();
    });

Edit: one more failed attempt, I just need to understand how the structure works...

	$url = 'https://www.sportsmanager.com.br/api/[email protected]&token=SLSO8342HSDE7GVS7234GNL&ano2018&status=A';
	$response = wp_remote_get( $url );
	$api_response = json_decode( wp_remote_retrieve_body( $response ), true );
	print_r ($api_response);
	echo $api_response;

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • Be careful not to leave your e-mail and token in the code or in the images of the question. Because other people can use this information

  • Thanks for the tip! I messed up the numbers

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.