Skip to main content
GET
/
regions
Go (SDK)
package main

import(
	"context"
	"os"
	latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
	"log"
)

func main() {
    ctx := context.Background()

    s := latitudeshgosdk.New(
        latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
    )

    res, err := s.Regions.Get(ctx, latitudeshgosdk.Pointer[int64](20), latitudeshgosdk.Pointer[int64](1))
    if err != nil {
        log.Fatal(err)
    }
    if res.Regions != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}
{
  "data": [
    {
      "id": "loc_k0RyqvNvqW36X",
      "type": "regions",
      "attributes": {
        "name": "Mraz, Pagac and Murazik",
        "slug": "mraz,-pagac-and-murazik",
        "facility": "Mraz, Pagac and Murazik",
        "country": {
          "name": "Wintheiser, Kreiger and Parisian",
          "slug": "wintheiser,-kreiger-and-parisian"
        },
        "type": "core"
      }
    }
  ],
  "meta": {}
}

Authorizations

Authorization
string
header
required

Query Parameters

page[size]
integer
default:20

Number of items to return per page

Required range: x >= 1
page[number]
integer
default:1

Page number to return (starts at 1)

Required range: x >= 1

Response

200 - application/vnd.api+json

Success

data
object[]