Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am a complete Newbie with regards to Resftul services etc, I am trying to connect to a Second Street Api using the below.
It seems you need to use a Post first to get an access toke, how would you go about this in POWERBI. Thanks
Second Street’s Messaging Analytics API allows partners to get detailed information about message campaigns sent via the Second Street Platform.
If you do not need the level of detail offered by direct access to a JSON API, Second Street also provides a series of Dashboards which will help you visualize some of this data.
This document outlines what you will need in order to build your own data visualizations, or otherwise use data about the Message Campaigns you’ve sent through our Platform.
Second street’s API is located at:
Second Street’s API is a RESTful api that accepts and returns JSON. As a RESTful API, the HTTP method used on a request is meaningful so please only use GETs when you intend to retrieve a record, POST to create a record, etc. More information will be provided about when it is appropriate to GET or POST in the discussions of the different endpoints below.
The following headers are meaningful when communicating with the API
Header | Req’d? | Expected Values |
Accept | Yes | application/json |
Accept-Language | Yes | Any valid language code Example: en-US,en;q=0.8 |
X-Api-Key | Yes | Any valid API Key Will be provided by Second Street |
X-Organization-Id | Yes | Any valid organization ID Will be provided by Second Street |
X-Referring-Url | Yes | The URL the form will be hosted on |
Authorization | Yes | An access token generated via sessions |
When requesting Categorical Charts or Messaging Statistics from the Second Street API, you can include one of the following query strings in your GET request to get data for different contexts:
When requesting data from certain endpoints of the Second Street API, you can include the following query strings in your GET request to page through data:
Paged endpoints will have a second JSON root object, meta. The meta object will have page_index, page_size, and total_records properties.
To begin a session that has the authority to access messaging analytics, perform a POST on /sessions:
POST to:
With body:
{ |
The username should be the email address of a Second Street user that has all roles. The password should be their password. Be sure you’re using HTTPS in the request URL, as you don’t want to send passwords over plain text!
If successful, the server will respond with
{ |
The most important value here is session.access_token. The access_token should be added to your headers to be used for all future requests as this identifies the user.
Solved! Go to Solution.
FYI we got it connecting using
let apiUrl = "https://api.secondstreetapp.com/sessions", data ="{'sessions':[{'username':'**', 'password': '**'}]}", options = [ Headers =[#"Content-Type"="application/json", #"X-Api-Key"="*****"], Content = Text.ToBinary(data) ], Value = Web.Contents(apiUrl,options), in Value
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.